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
Solved

W0rking with Seesions

Posted on 2008-10-18
7
197 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

808 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