redirectMode="ResponseRewrite"
Page_Load
Session
Page
If an error occurs on any page, the user is redirected (via Rewrite) to the Error.aspx page. There, at Page_Load from MasterPage, we access the session and get an HttpException telling us to enable the SessionState. But we have SessionState enabled, definitely.
How can we access the session after UrlRewrite in the Page_Load event of our MasterPage?
:
if( HttpContext.Current.Session != null ) { //Access Session here... }
, , , ErrorPage.
, HttpContext.Current.Session HttpException, Page.Session .
HttpContext.Current.Session
HttpException
Page.Session
...
HttpContext.Session null, redirectMode = ResponseRewrite
, , , redirectMode - Global.asax Application_Error, , . " " , :
if(Context.IsCustomErrorEnabled) { Server.Transfer("~/Error.aspx"); }
Error.aspx Page_Load, .
Source: https://habr.com/ru/post/1754787/More articles:Can I lock a file? - c #How do you reference the appropriate object from a DataTemplate in XAML? - c #How to check the type of a child in a div? - jqueryWhen I upload an image to OpenCV, it is always darker than the original. What for? - colorsКаковы основные принципы проектирования по шаблону Injection Dependency - c#combo box and general list - c #https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1754789/in-a-wpf-user-control-how-do-i-specify-coordinates-relative-to-the-controls-total-size-so-that-the-control-will-scale-correctly&usg=ALkJrhi_mdH85VByZnWAtSBfEInBOCMlxwAccording to the event of program loading ..? - flexWPF canvas button? - .net$ .getJSON for the progress bar does NOT work in Safari and Chrome (but OK in IE6 + and FF) - jqueryAll Articles