Error occour because of hidden control.
Solution:
Change the linkbuttons that were not hidden to cause validation to false.
Property :(CauseValidation=False)
Wednesday, February 10, 2010
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
Sunday, October 4, 2009
how to clear cookies/cache for browser using C# .NET
using System.IO;
void clearIECache()
{
ClearFolder (new DirectoryInfo (Environment.GetFolderPath
(Environment.SpecialFolder.InternetCache)));
}
void ClearFolder (DirectoryInfo folder)
{
foreach (FileInfo file in folder.GetFiles())
{ file.Delete(); }
foreach (DirectoryInfo subfolder in folder.GetDirectories())
{ ClearFolder(subfolder); }
}
public static void Main( )
{
new Test().clearIECache ();
}
void clearIECache()
{
ClearFolder (new DirectoryInfo (Environment.GetFolderPath
(Environment.SpecialFolder.InternetCache)));
}
void ClearFolder (DirectoryInfo folder)
{
foreach (FileInfo file in folder.GetFiles())
{ file.Delete(); }
foreach (DirectoryInfo subfolder in folder.GetDirectories())
{ ClearFolder(subfolder); }
}
public static void Main( )
{
new Test().clearIECache ();
}
Subscribe to:
Posts (Atom)