Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

.net - Is there a way to declaratively set ServicePointManager's ServerCertificateValidationCallback property from *.config file? -


i looking way disable cert validation in declarative way. usefull i.e. when using svcutil.exe.

so far know how disable hostname validation:

<system.net>     <settings>         <servicepointmanager checkcertificatename="false" />     </settings> </system.net> 

but not sufficent. i've seen claiming can done, wihtout sample.

i'm using ugly hack using in unittests :(

app.config:

<system.net>     <webrequestmodules xdt:transform="insert">         <clear/>         <add prefix = "http" type = "httprequestcreatorwithservercertificatevalidationcallback, testhelpers"/>         <add prefix = "https" type = "httprequestcreatorwithservercertificatevalidationcallback, testhelpers"/>     </webrequestmodules> </system.net> 

httprequestcreatorwithservercertificatevalidationcallback.cs

public class httprequestcreatorwithservercertificatevalidationcallback : iwebrequestcreate {     static httprequestcreatorwithservercertificatevalidationcallback()     {         var type = typeof(httpwebrequest).assembly.gettype("system.net.httprequestcreator");         var ctor = type.getconstructors()[0];         creator = (iwebrequestcreate)ctor.invoke(null);          servicepointmanager.servercertificatevalidationcallback += delegate         {             return true;         };     }      #region iwebrequestcreate members      public webrequest create(uri uri)     {         return creator.create(uri);     }      #endregion      private static readonly iwebrequestcreate creator; } 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -