我有一个文件SiteMinder.CS在App_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)