【发布时间】:2017-02-20 14:17:45
【问题描述】:
我有一个 WebForms 应用程序 (.Net Framework 4.5.2)。我需要将一些页面重定向到外部网页示例 www.google.com
我尝试修改路线
public class Global : HttpApplication
{
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
private void RegisterRoutes(RouteCollection routes)
{
}
}
我需要知道
- 最好的方法是什么?
- 如何更改我的代码来完成这项任务?
谢谢,
【问题讨论】:
-
你可以只使用 Response.Redirect 方法
-
@Sergey 我需要一个全局路由配置
标签: c# asp.net .net redirect webforms