Jul212011

Disable Browser Back Button using csharp

Disable Firefox and IE Back Button in Asp.net public void ClearBrowserCache(){      HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);  HttpContext.Current.Response.Cache.SetExpires(DateTime.Now); HttpContext.Current.Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1));       HttpContext.Current.Response.Cache.SetNoStore();      } call this method in each and every page load Event. note:This functionality will not work when you call Server.Transfer for page redirection...

Jul042011

The remote certificate is invalid

The remote certificate is invalid according to the validation procedure you will get this error because of certificates issue while getting the response from the external web service or any other Web Request from the server. follow the below snippet to resolve this issue using System.Net; using System.Net.Security; using System.Security.Cryptography.X509Certificates; protected void Page_Load(object sender, EventArgs e) { ServicePointManager.ServerCertificateValidationCallback = RemoteCertificateValidationCB; Uri uri = new Uri("http://microsoft.com"); if (uri.Scheme == Uri.UriSchemeHttp) { HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri); request.Method = WebRequestMethods.Http.Get; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); StreamReader...

Pages 141234 »