c# .NET
I want a method that works in every page in my website
I have done this so far
I get these errors
Why?
I am using System.Web.Sess ionstate. so it should find Session. when i have the same code in a page it works.
please help me i have search for help with this but havn't found it.
I want a method that works in every page in my website
I have done this so far
Code:
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Web.Sessionstate; public class SafeClass { public bool Safepage() { bool safe = true; if (Session["USERID"] == null) safe = false; else { if (Request.QueryString["ID"] != null) { if (Request.QueryString["ID"] != Session["USERID"].ToString()) safe = false; } else safe = false; } return safe; } }
- The name 'Session' does not exist in the current context
- The name 'Request' does not exist in the current context
- The name 'Request' does not exist in the current context
- The name 'Session' does not exist in the current context
Why?
I am using System.Web.Sess ionstate. so it should find Session. when i have the same code in a page it works.
please help me i have search for help with this but havn't found it.
Comment