////// PageBaseNew 的摘要说明 ///public class PageBaseNew:System.Web.UI.Page { public PageBaseNew() { this.Load += new System.EventHandler(PageBaseNew_Load); } private void PageBaseNew_Load(object sender, System.EventArgs e) { if (Session["userid"] == null) { Response.Write("");//考虑到框架问题 } } public string BaseUrl { get { string strBaseUrl = ""; strBaseUrl += "http://" + HttpContext.Current.Request.Url.Host; if (HttpContext.Current.Request.Url.Port.ToString() != "80") { strBaseUrl += ":" + HttpContext.Current.Request.Url.Port.ToString(); } strBaseUrl += HttpContext.Current.Request.ApplicationPath; return strBaseUrl + "/"; } } }
重写页面基类(判断丢失Session)-保证不丢失VIEWSATE-完美解决方案
关注
打赏