Solved

W0rking with Seesions

Posted on 2008-10-18
7
199 Views
Last Modified: 2012-05-05
Hello,

I need a seesionto be created pnce User is logged in , and end his seesion once he log's out.
Please tell me is this right way to go further:

I'm getting null values in the transition pages, once the session variable is created.

Thanks.
Login.aspx:
Session["User"]= tbUser.text;
 
Transaction.aspx:
Session[user];
 
tbID.text = Session[user].ToString();

Open in new window

0
Comment
Question by:DevIndian
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 8

Expert Comment

by:vsudip
ID: 22749065
0
 
LVL 13

Expert Comment

by:sm394
ID: 22749144
change that
tbID.text = Session[user].ToString();
To
tbID.text = Session["User"].ToString();
0
 

Author Comment

by:DevIndian
ID: 22749178
No still ,I'm getting Null values
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Assisted Solution

by:sm394
sm394 earned 100 total points
ID: 22749270
when you set session i assume there

Session["User"]= tbUser.text;

debug and check what value is being assigned
0
 
LVL 16

Accepted Solution

by:
Gyanendra Singh earned 200 total points
ID: 22749286
on Login.aspx.cs

on button submit add this
Session["User"]= tbUser.text;

and on Transaction.aspx.cs

on page load event add this
tbID.text = Session["User"].ToString();

remove this Session[user];


0
 
LVL 26

Assisted Solution

by:Anurag Thakur
Anurag Thakur earned 200 total points
ID: 22749403
Modifying the solution provided by BondInASP a little bit

on Login.aspx.cs
      on button submit add this
      Session["User"]= tbUser.text;

and on Transaction.aspx.cs
      on page load event first check whether the session is still valid or not
      check this before retriving user from session
      if (Session["User"] != null)
            tbID.text = Session["User"].ToString();

remove this Session[user] = null;
0
 

Author Comment

by:DevIndian
ID: 22750025
Thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question