日期:2014-05-17 浏览次数:20408 次
public class BasePage : System.Web.UI.Page { public BasePage() { this.Load += new EventHandler(BasePage_Load); } void BasePage_Load(object sender, EventArgs e) { if (Session["username"] == null||Session["username"].ToString().Equals(" ")) { Response.Write("<script>alert('请先登录!');window.location='../Default.aspx';</script>"); } } }
public partial class _Default : BasePage { protected void Page_Load(object sender, EventArgs e) { .......... } }