Question

Using http handlers I am redirecting the users to some other page. Example: if we enter about.aspx, i will redirect the user to page.aspx?pageid=20 using server.transfer. But the problem is,in page.aspx at following statement i am getting below error. session["userid"]= "xyz";

Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the \\ section in the application configuration.

Était-ce utile?

La solution

If you want to access session state in httphandler, you have to implement IRequiresSessionState interface along with IHttpHandler.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top