473,425 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,425 software developers and data experts.

session varaibles with asp.net urgent help

hi i store some value in session object and later try to access it but the
value return from session variable is null
like
Session["Myname"]=txtmyname.Text;
Session["Age"]=txtAge.Text;
Response.Redirect("Welcome.aspx");
when this page loaded and iin page load event i called
lblMyname.Text=(string)session["Myname"];
lblAge.Text=(string)session["Age"];
it return null value instead of actual values.
i tried to store session value both in sql database and local memory both
result are same

Jul 7 '06 #1
6 1123

amjad wrote:
hi i store some value in session object and later try to access it but the
value return from session variable is null
like
Session["Myname"]=txtmyname.Text;
Session["Age"]=txtAge.Text;
Response.Redirect("Welcome.aspx");
when this page loaded and iin page load event i called
lblMyname.Text=(string)session["Myname"];
lblAge.Text=(string)session["Age"];
it return null value instead of actual values.
i tried to store session value both in sql database and local memory both
result are same
The possible chances are these:
1. you have started session somewhere else (on anyother page) as well
and
session is not abondened yet (with session.abonden).

2.
lblMyname.Text=(string)session["Myname"]; //session's s should be capital i.e Session

3. or try this instead

lblMyname.Text=Session["email"].ToString();

Jul 7 '06 #2

3.
lblAge.Text=Session["Age"].ToString()

Jul 7 '06 #3
its not the Session i wrote small otherwise c # cannot compile. . i have
cancelled the session variable but still cannt display that value in another
page.
"na********@yahoo.com" wrote:
>
amjad wrote:
hi i store some value in session object and later try to access it but the
value return from session variable is null
like
Session["Myname"]=txtmyname.Text;
Session["Age"]=txtAge.Text;
Response.Redirect("Welcome.aspx");
when this page loaded and iin page load event i called
lblMyname.Text=(string)session["Myname"];
lblAge.Text=(string)session["Age"];
it return null value instead of actual values.
i tried to store session value both in sql database and local memory both
result are same

The possible chances are these:
1. you have started session somewhere else (on anyother page) as well
and
session is not abondened yet (with session.abonden).

2.
lblMyname.Text=(string)session["Myname"]; //session's s should be capital i.e Session


3. or try this instead

lblMyname.Text=Session["email"].ToString();

Jul 7 '06 #4
where have you cancelled/cleared the session?

Jul 7 '06 #5
when i do that instead of (string)Session["Age"] then it gave me that error
System.NullReferenceException: Object reference not set to an instance of an
object.
"na********@yahoo.com" wrote:
>
3.
lblAge.Text=Session["Age"].ToString()

Jul 7 '06 #6

amjad wrote:
when i do that instead of (string)Session["Age"] then it gave me that error
System.NullReferenceException: Object reference not set to an instance of an
object.
"na********@yahoo.com" wrote:

3.
lblAge.Text=Session["Age"].ToString()
where ever if you have used session.clear or session.removeall replace
it with
session.abondon();
try whats happen?

Jul 7 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Manu J | last post by:
Hi, i have a login script which makes use of sessions. Login script *********** session_start() ..... ..... ....
3
by: sunnyz | last post by:
hi I wanted to know whether we can store something in Session objects in webservice.My windows application calls the webservice and i want the data to be stored in Session object so that each user...
4
by: Nick | last post by:
Hi I am a little stuck. I have a web app which uses cookieless session management. I would like to inform a user when their session has ended but cannot work out how to implement. I thought...
2
by: Jim | last post by:
Hi, I am using forms based authentication for my website. Whilst testing I have noticed that occasionaly it appears that the Context.User.Identity.Name is valid however the session variables...
1
by: So | last post by:
In VS2003, when debugging (with breakpoints set) a ASP.net web project (locally), if an error/exception occurs the browser navigates to the "Server Error" page. After this point it looses all the...
14
by: Coleen | last post by:
Hi All :-) We have an APSX application using VB.net as the code behind, which uses one or two session variables per page. These Session variables are passed to the final page and calculations...
7
by: mantrid | last post by:
I have some code to upload files to my site. it works when the <input type="file" is posted once even when I use session variables from the posted variables but when I carry those session variables...
2
by: Orgil | last post by:
I'm using ASP 3.0 however there is ASP.NET, because I'm working an old site that is built in ASP 3.0. I hope you for getting any help for my problem from you. So, my site's sessions are empty...
1
by: webdevaccount | last post by:
Hi, I am trying to deceive whether I should use Asp.net 2.0's FormAuthentication (cookie) or the Session object to store the login ID of a given user. Question 1: Assuming that the app will...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.