Upgrading the use of session variables...

G

Guest

I have the following snipets of code that work fine in my ASP 1.1 application

This code just takes a string description from one page and passes it to
another page but in the conversion to 2.0 it just comes up blank:

=====1st page (submit button)=====
dim sSearchingFor as string
sSearchingFor = "MRN : " & Me.txtNAME_ID.Text
Session.Add("SDesc", sSearchingFor)

Response.Redirect("MemberResults.aspx", True)

====2nd page(load event)========
lblSDesc.Text = "Searched for " & Session("SDesc")

(This is coming up blank in 2.0)


What is the upgraded method for this technique?
 
N

Nathan Sokalski

Well, I will admit that I have never used 2.0, but I want to be clear about
your problem. Does lblSDesc.Text end up with the value "Searched for " or
""? Is the other code in the Load event on the 2nd page being executed? I am
simply trying to determine whether the problem is with Session (your Session
statements look correct to me, although I would suggest placing the
retrieval inside a CStr() function) or with something else such as the
wiring up of the Load event. Try checking some of these things, and possibly
checking the values of the variables/objects involved using the debugger.
Good Luck!
 
G

Guest

In my 1.1 application, the 2nd page gets a display like this:

Searched for: Fullname beginning with 'Smith, Jo'

or

Searched for: SSN - 123456789

(they are just descriptions of what the user searched for - created by
concatenating text that the user typed in the boxes)

In my 2.0 application, the 2nd page gets a display like this:

Searched for:

(--- and nothing))

Incidentally, there are no warnings about this in the 2.0 app.
 
R

Ray Booysen

What Nathan was asking was is the search text actually in the textbox
when the code is run?
 
G

Guest

yes, it was. In fact - the 2 examples I provided are text that I supplied in
the textbox.

However, why would that answer why it works in 1.1 and not in 2.0?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top