Hi all,
I really need some help. I have a asp.net web project using c#.
I have put one of my datafield in session in one webform and I am calling that same datafield of the session to another web form within a same project.
I worked before and now all of a sudden I am getting null value in my second form when i try to extract from session variable.
As far as I know I haven't change anything in this project.
and my syntaxt is: -
Session["qid"] = qid; ....................webform1
-
-
string getid = Session["qid"].ToString();..............webform2
-
what should I do to resolve this?
Thank You,
12 3354
is this code
string getid = Session["qid"].ToString();
in the page load of webform2?
you shud be able to debug and find out the value of that session variable before getting redirected from webform1 to webform2. Have you tried it?
I am calling string getid = Session ["qid"].ToString(); to one of the method that I call on page load.
like, -
page load()
-
{
-
Getpdfs();
-
}
-
public void pdfs()
-
{
-
string getid = Session ["qid"].ToString();
-
}
-
yes.. On my webform1 I can see the value getting into session during the debugging but when it comes to webform 2
string getid = session["qid"].Tostring();
getid come with null value.
Ok. here I found something strange.
I can get session variable to my webform3 because I have several webforms withing same projetc.
But, I can not get session variable on webform 2.
How can this possible? And I can not find anything wrong with my webform2.
Please help me if any one of you have any idea on this.
Thank You,
Your code: - page load()
-
{
-
Getpdfs();
-
}
-
public void pdfs()
-
{
-
string getid = Session ["qid"].ToString();
-
}
Is it because of this reason
Modification, notice the change of the method !!!! - page load()
-
{
-
Getpdfs();
-
}
-
public void Getpdfs() //notice the change
-
{
-
string getid = Session ["qid"].ToString();
-
}
I just a typo error on my previous post about the function.
I do have the function's correct name but it not working.
Do you have any Session.Abandons() in your pages?
Or anything that would tell the client browser to drop the cookie?
I am not sure what is Session.Abandons() .
but, what I just recently discover is,
I can get session variable to my second form if in my hyper link I have address like: http://localhost/form2.
but if I replace my localhost to IP address I can't get session variable.
like, http://10.10.10.10/form2 does not give me session variable.
Why it would behave right with localhost and won't work with IP address?
Thank You,
I am thinking it is client side.
There is a special header that gets passed in the request/responses that contains the session id for the user.
If the browser doesn't send the special header, the server assumes it's a new "user" and gives it a new session id, giving the appearance that the session values have been lost.
The browser might not understand it needs to send the header if you switch up the URL address.
I think URL address is same like,
home page is like,
http://10.10.10.10/form1
there is a link on form1 which takes to form2
with a url
http://10.10.10.10/form2.
if I replace my ip address with localhost it works but if I have IP address it won't work.
Thank you
Does it work with http://127.0.0.1/ ?
No. and I get this error message when I use my IP Address on hyperlink. -
Object reference not set to an instance of an object.
-
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
-
-
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
-
-
Source Error:
-
-
-
Line 42: {
-
Line 43: // Put user code to initialize the page here
-
Line 44: getqid = Session["qid"].ToString();
-
Line 45: buildQuickcheck();
-
Line 46:
-
-
-
Source File: d:\devsite\tap\checkoutform\qcheck.aspx.cs Line: 44
-
-
Stack Trace:
-
-
-
[NullReferenceException: Object reference not set to an instance of an object.]
-
CheckOutForm.QCheck.Page_Load(Object sender, EventArgs e) in d:\devsite\tap\checkoutform\qcheck.aspx.cs:44
-
System.Web.UI.Control.OnLoad(EventArgs e) +67
-
System.Web.UI.Control.LoadRecursive() +35
-
System.Web.UI.Page.ProcessRequestMain() +750
-
-
-
-
-
Yeah, you're def getting a fresh session there (Whether it thinks your a new user or for some reason flushed the existing, I don't know)
What is your session timeout set to?
Also, you know when you do a build of the website your session values are wiped out.
You could try packet watching to see if the session ID stays the same in all the request/responses
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jeremy Ames |
last post by:
I have created a web application that uses a custom control and a web
service on my local system. I have gotten all of the bugs worked out on my
local system and now it is time to move it to the...
|
by: Baruaa |
last post by:
hi i m asheesh ,
can any on ehelp me about this error.
Line 57: -->
Line 58: <httpHandlers>
Line 59: <add verb="*" path="*.vb"
type="System.Web.HttpNotFoundHandler,System.Web" />
|
by: James Wong |
last post by:
Hi everybody,
I'm developing a web service using VB.NET which calls a web form to let user
input something. In web service, I use Server.Execute ("WebForm.aspx") to
load and execute the web...
|
by: Erick Lopez |
last post by:
When I send my web page to browser in ouput windows recibe this message
and the web page the error BC32400
Please Help me
Auto-attach to process ' aspnet_wp.exe' on machine 'TABLET'...
|
by: Param R. |
last post by:
Hi all, we recently upgraded our servers to 2003 and have begun seeing
several problems. We have a web services that runs locally and is called by
..aspx pages of other websites. Ever since the...
|
by: Tim Cartwright |
last post by:
I have a page that has the login control on it, nothing else. This page inherits from a master page, neither page has any code in it. This page works perfectly when running on the WebDev debug web...
|
by: Jonas |
last post by:
Hi.
I'm trying to develop a web custom control that uses a programmatically
created treeview.
My problem is that I get an exception when I try to render the control.
With properties do I have to...
|
by: job |
last post by:
In a sharepoint setup using smartpart to load our user controls using
enterprise blocks (data) we are getting some strange errors (logged to
the event log). We dont get the error all the time. When...
|
by: Jeff |
last post by:
Hey
asp.net 2.0
My asp.net 2.0 project has got a assembly load problem:
Some of my web.config settings:
<membership defaultProvider="AH_MembershipProvider"
userIsOnlineTimeWindow="15">
|
by: =?Utf-8?B?cmtibmFpcg==?= |
last post by:
I was executing the steps given in http://suppor.microsoft.com/kb/308359 for
testing a sample web service application. However, the following line gives a
compilation error:
localhost.Service1...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
|
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,...
| |