문제

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