Hi, you used Request.ServerVariables("SCRIPT_NAME") as a function
which's not a function, its a property. Try using
Request.ServerVariables["SCRIPT_NAME"]. It will work if
Request.ServerVariable supports indexing, I havent tested this though.Cheers... On Thu, Mar 12, 2009 at 3:51 PM, nag <[email protected]> wrote: > > hi here is my code for removing *.aspx extension from the current > page > > protected void Page_Load(object sender, EventArgs e) > { > if (HttpContext.Current.User.Identity.IsAuthenticated) > { > string MyPage = System.IO.Path.GetFileName > (Request.ServerVariables("SCRIPT_NAME")).Substring(0, > ((System.IO.Path.GetFileName(Request.ServerVariables > ("SCRIPT_NAME")).IndexOf(".") + 1) - 1)).ToLower(); > Response.Write(("<a href=\'/admin/siteadministration.aspx? > page="+ (MyPage + "\'>Edit this page</a>"))); > } > > } > i'm getting following error.please help me to get the proper result > > CS0118: 'System.Web.HttpRequest.ServerVariables' is a 'property' but > is used like a 'method'
