Solved

W0rking with Seesions

Posted on 2008-10-18
7
198 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
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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

697 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