Something like this might work:String sn = HttpContext.Current.Request.ServerVariables("SCRIPT_NAME");I'm not a C# expert, though.