I need to grab the value of a hidden field from a Master page and use the value as a global variable on a child page.

What I did was put this into the Public Partial Class:

    public partial class frmBenefitSummaryList : System.Web.UI.Page
        //public string PlanID = Convert.ToString(Request.QueryString["PlanID"]);
        //public string AuditID = Convert.ToString(Request.QueryString["AuditID"]);
        //public string UID = LoginSecurity.GetUser("ID");
        public string SecLevel = (HiddenField)Page.Master.FindControl("hdnSecLevel");

C# doesn't like this, says "A field initializer cannot reference the non-static field, method, or property 'Control.Page'"

How would I go about doing something like this?

Related posts

Recent Viewed