New Message on dotNET User Group Hyd

Error in ASP.NET Sessions!!!!

Reply
  Reply to Sender   Recommend Message 1 in Discussion
From: AlwaysLakshmi

Hi,
 
I am trying to use sessions to pass values between asp.net pages.
 
Firstpage.aspx
 

Session["Sample1"] = Value1;

Session["Sample2"] = Value2;

I have given EnableSessionState in the Page Directive. In the web.config file, the sessionstate tag is as shown below:

<sessionState mode="Inproc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="server=127.0.0.1;Trusted_Connection=yes"  cookieless="true" timeout="20" />

But i am getting the following error:

Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive

I have looked google for help and found some articles as below:

http://dotnet247.com/247reference/msgs/24/124005.aspx

http://www.kdkeys.net/forums/376/ShowPost.aspx

http://www.visual-basic-data-mining.net/forum/PrintPost.aspx?PostID=376

After going through the above links i have added:

override protected void OnInit(EventArgs e)

{

//

// CODEGEN: This call is required by the ASP.NET Web Form Designer.

InitializeComponent();

string name1= (string)Session["Sample1"];

string name2 = (string)Session["Sample2"];

base.OnInit(e);

}

But i am still getting the same error!!!!

Please let me know how i can solve this problem................

Thanks in advance

Regards

Lakshmi

(http://techsavygal.blogspot.com)


View other groups in this category.

Click Here
Also on MSN:
Start Chatting | Listen to Music | House & Home | Try Online Dating | Daily Horoscopes

To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings.

Need help? If you've forgotten your password, please go to Passport Member Services.
For other questions or feedback, go to our Contact Us page.

If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list.
Remove my e-mail address from dotNET User Group Hyd.

Reply via email to