【发布时间】:2017-01-11 07:04:57
【问题描述】:
我需要从母版页中获取隐藏字段的值,并将该值用作子页上的全局变量。
我所做的就是把它放到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# 不喜欢这样,说“A field initializer cannot reference the non-static field, method, or property 'Control.Page'”
我将如何去做这样的事情?
【问题讨论】:
标签: c# asp.net master-pages