111,098
社区成员




public partial class MasterPageApplication_ParentPage : System.Web.UI.MasterPage
{
public string strCon = System.Configuration.ConfigurationManager.AppSettings["ConnStr"];
protected void Page_Load(object sender, EventArgs e)
{
Ajax.Utility.RegisterTypeForAjax(typeof(MasterPageApplication_ParentPage));
incon.Value = this.Application["ConnStr"].ToString();
if (!IsPostBack)
{
#region 初始化
if (Session["LoginUserNm"] != null)
{
UserName.Text = Session["LoginUserNm"].ToString();
divuserid.Style["display"] = "none";
divpassword.Style["display"] = "none";
divusername.Style["display"] = "";
btnlogin.Style["display"] = "none";
btnlogout.Style["display"] = "";
btnmodify.Style["display"] = "";
}
else
{
divuserid.Style["display"] = "";
divpassword.Style["display"] = "";
divusername.Style["display"] = "none";
btnlogin.Style["display"] = "";
btnlogout.Style["display"] = "none";
btnmodify.Style["display"] = "none";
}
#endregion
}
}
}
protected internal override HttpContext Context
{
[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
get
{
if (this._context == null)
{
this._context = HttpContext.Current;
}
return this._context;
}
}
public virtual HttpSessionState Session
{
get
{
if (!this._sessionRetrieved)
{
this._sessionRetrieved = true;
try
{
this._session = this.Context.Session;
}
catch
{
}
}
if (this._session == null)
{
throw new HttpException(SR.GetString("Session_not_enabled"));
}
return this._session;
}
}