我想重定向時方法的Session_OnEnd()在Global.asax中ASP.NET MVC重定向OnEnd
如果鍵入
public void Session_OnStart()
{
HttpContext.Current.Response.Redirect("http://www.google.es");
}
而且去谷歌,但是當我嘗試這個onEnd .. 。
public void Session_OnEnd()
{
HttpContext.Current.Response.Redirect("http://www.google.es");
}
顯示
「的NullReferenceException w ^如用戶代碼未處理「,對象引用 未設置爲對象的實例。
任何人都可以幫助我嗎?
你如何測試Session_OnEnd? – ssilas777 2015-02-11 15:41:40
但看起來像沒有接受的答案.. – ssilas777 2015-02-11 15:43:06
@ ssilas777這並不一定意味着沒有一個正確的或有效的答案。 – Rhumborl 2015-02-11 15:45:27