firebird
firebird

Reputation: 3511

Server.Transfer, session state null

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

Answers (3)

Praneeth
Praneeth

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

Arie van Someren
Arie van Someren

Reputation: 457

Could you check if the enableSessionState="true" is set in the page tag in the web.config?

Upvotes: 0

Justin Pihony
Justin Pihony

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

Related Questions