473,289 Members | 1,963 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,289 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 1120

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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.