我无法在所有网页中找到重用以下代码的方法。如何重用此C#代码?
我该怎么办?
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Page.Request.UrlReferrer == null)
{
Response.Redirect("test.aspx");
}
}
}
我倒是喜欢用这样的:
protected void Page_Load(object sender, EventArgs e)
{
CheckURL();
}
请给我一个例子! :)我新使用C#!
对System.Web.UI.Page类的扩展方法将工作,以及添加此。 – 2011-05-24 19:43:54
正是我们所做的。如果你喜欢,你可以在web.config中为你的新基页设置
n8wrl
2011-05-24 19:43:56