您当前的位置: 首页 > 

暂无认证

  • 0浏览

    0关注

    101061博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

重写页面基类(判断丢失Session)-保证不丢失VIEWSATE-完美解决方案

发布时间:2010-06-28 20:55:00 ,浏览量:0

////// 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 + "/";
        }
    }
}
 
关注
打赏
1655516835
查看更多评论
立即登录/注册

微信扫码登录

0.4259s