Here's what I've been using:
public static string PageName()
{
string strTemp;
int intPos;
strTemp =
System.Web.HttpContext.Current.Request.ServerVaria bles["SCRIPT_NAME"].ToStri
ng();
intPos = strTemp.LastIndexOf("/");
strTemp = strTemp.Substring(intPos + 1);
return strTemp;
}
"Jeff" <A@B.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I need to determine, at runtime, the page name of the currently requested
aspx page.
Page.ToString(), returns sumething like "ASP.MyFile_aspx". What I'd prefer
is to get the actual file name "MyFile.aspx".
Any suggestions?
Thanks.