在我的web應用程序中,我正在驗證來自glabal.asax的url。我想驗證網址,如果需要的話需要重定向到一個動作。我正在使用Application_BeginRequest來捕獲請求事件。重定向到global.asax的動作 - mvc
protected void Application_BeginRequest(object sender, EventArgs e)
{
// If the product is not registered then
// redirect the user to product registraion page.
if (Application[ApplicationVarInfo.ProductNotRegistered] != null)
{
//HOW TO REDIRECT TO ACTION (action=register,controller=product)
}
}
或者有沒有其他的方法來驗證每一個URL同時獲得MVC中的請求,並根據需要
http://stackoverflow.com/questions/580728/redirecting-from-global-asax-in-medium-trust – Baz1nga