Reputation: 3511
Why is the session state null when you use Server.Transfer? Is there anyway to enable the session? (session state is already enabled and working fine, it's just that HttpContext.Current.Session is null when you Server.Transfer into a new page within the same site)
Upvotes: 1
Views: 2486
Reputation: 2547
Add this to your page.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="NewPage" **EnableSessionState="True"** %>
May be try this as well: Context.RewritePath
instead of sever.transfer
Upvotes: 1
Reputation: 457
Could you check if the enableSessionState="true" is set in the page tag in the web.config?
Upvotes: 0
Reputation: 67075
I am not sure if this is a duplicate or just very similar. However, it does look a lot like a duplicate of this question
Either way, it looks like somebody already had a bear of a time with it or else it would not have had a 200 point bounty :). So, hopefully you can benefit.
Upvotes: 0