質問

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.

役に立ちましたか?

解決

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top