小编ton*_*dle的帖子

即使宣布公开,财产也会失去价值

我有一个文件SiteMinder.CSApp_code这里我设置了UserID谁访问的网页

public class SiteMinder : IHttpModule
    {
        public string UserID { get; set; }

        public void Init(HttpApplication context)
        {
            context.PreRequestHandlerExecute += new EventHandler(Application_PreRequestHandler);
        }

        private void Application_PreRequestHandler(Object source, EventArgs e)
        {
            if (HttpContext.Current.Request.Headers != null)
            {
                NameValueCollection coll = HttpContext.Current.Request.Headers;
                UserID = coll["uid"]; // Doesn't have NULL value
            }
        }
    }
Run Code Online (Sandbox Code Playgroud)

在另一个网页UserDetails.aspx.cs文件中,我正在尝试访问它,UserID但它NULL有价值.

public partial class UserDetails : System.Web.UI.Page
{

    protected string SessionUser { get; set; }
    protected void …
Run Code Online (Sandbox Code Playgroud)

c# asp.net encapsulation properties

0
推荐指数
1
解决办法
120
查看次数

标签 统计

asp.net ×1

c# ×1

encapsulation ×1

properties ×1