are you trying to get the membership info?
Here is some sample code that works for me in my page_unload event.
protected void Page_UnLoad(object sender, EventArgs e)
{
string urlReferrer = string.Empty;
string userAgent = string.Empty;
string userHostName = string.Empty;
string userHostAddress = string.Empty;
string userPrimaryLanguage = string.Empty;
string sessionId = string.Empty;
if (HttpContext.Current.Request.UrlReferrer != null)
{
urlReferrer = HttpContext.Current.Request.UrlReferrer == null ? string.Empty : HttpContext.Current.Request.UrlReferrer.ToString();
userAgent = HttpContext.Current.Request.UserAgent == null ? string.Empty : HttpContext.Current.Request.UserAgent.ToString();
userHostName = HttpContext.Current.Request.UserHostName == null ? string.Empty : HttpContext.Current.Request.UserHostName.ToString();
userHostAddress = HttpContext.Current.Request.UserHostAddress == null ? string.Empty : HttpContext.Current.Request.UserHostAddress.ToString();
userPrimaryLanguage = HttpContext.Current.Request.UserLanguages == null ? string.Empty : HttpContext.Current.Request.UserLanguages[0].ToString();
sessionId = Session.SessionID.ToString();
}
string userName = string.Empty;
if (IsPostBack)
{
userName = "PostBack";
}
else
{
userName = string.Empty;
}
utils.LogPageLoadTime(startTime, "Default.aspx", userName,
urlReferrer, userAgent, userHostName, userHostAddress, userPrimaryLanguage,sessionId);
}
Peter Kellner
http://73rdstreet.com and blogging at
http://PeterKellner.netMVP, ASP.NET