string s = HttpContext.Current.Request.ServerVariables["SCRIPT_NAME"]; //notice the [] and not ()If still having problems, send the exact error message.