Session 的问题,在线等......
我的代码如下:(这是在一个MasterPage页的page_Load里)
if (!Page.IsPostBack)
{
if (Session[ "ACRA_NO "] == null)
{
if (Page.User.Identity.Name != null && Page.User.Identity.Name != string.Empty)
{
ADService.ADWebService adws = new ADService.ADWebService();
DataSet userDetail = adws.GetESUserInfoByUserID(Page.User.Identity.Name);
if (userDetail.Tables[0] != null)
{
if (userDetail.Tables[0].Rows.Count != 0)
{
if (userDetail.Tables[0].Rows[0][ "USER_TYPE "] != null && userDetail.Tables[0].Rows[0][ "USER_TYPE "].ToString() == "4 ")
Session[ "ACRA_NO "] = userDetail.Tables[0].Rows[0][ "COMPANY_ID "] == null ? " " : userDetail.Tables[0].Rows[0][ "COMPANY_ID "].ToString();
}
}
}
}
}
然后我在一个页面里注册,并写属性如下:
<%@ Page Language= "C# " MasterPageFile= "~/MasterPage.master &qu