c# - To check if session is available or not -
i tried code in application_error
this
session["mysession"] = "some message";
but problem session not available in application_error
. want check whether session available or not.
session
doesn't exist within context of current application_error
. try following:
protected void application_error(object sender, eventargs e) { if (context.handler irequiressessionstate || context.handler ireadonlysessionstate) { // session exists session["mysession"] = "some message"; } }
Comments
Post a Comment