【发布时间】:2015-02-11 10:25:22
【问题描述】:
我正在尝试一个简单的路由,我的 global.asax 如下所示
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
registerroutes(RouteTable.Routes);
}
public static void registerroutes(RouteCollection routecollection)
{
routecollection.MapPageRoute("home","home/","~/home.aspx");
}
我的主页
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
Response.Redirect(ResolveUrl("~/home/"));
}
}
但没有正确重定向不知道我错在哪里
【问题讨论】: