write code on page load event
if(!Request.IsSecureConnection)
{
string redirectUrl = Request.Url.ToString().Replace("http:", "https:");
Response.Redirect(redirectUrl);
}
Monday, April 12, 2010
Wednesday, February 10, 2010
WebForm_DoPostBackWithOptions vs __doPostback: Link button not working
Error occour because of hidden control.
Solution:
Change the linkbuttons that were not hidden to cause validation to false.
Property :(CauseValidation=False)
Solution:
Change the linkbuttons that were not hidden to cause validation to false.
Property :(CauseValidation=False)
Tuesday, February 9, 2010
Get current page name in ASP.Net
public string GetCurrentPageName()
{
string sPath = System.Web.HttpContext.Current.Request.Url.AbsolutePath;
System.IO.FileInfo oInfo = new System.IO.FileInfo(sPath);
string sRet = oInfo.Name;
return sRet;
}
Monday, February 8, 2010
Subscribe to:
Posts (Atom)