Easy question about passing session value

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

HI! How do we pass a value in a link to a session variable?

Is it like this for a string?

somefile.htm?="450px"

I am going to be using vbscript.
 
1. Make all page with a .asp extensions if you plan to use sessions.

2. somefile.asp?psize=450px

Then on next page:

3. Session("psize") = Request.QueryString("psize")

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
PS
Unless you are going to just display the psize as text on the next page you probably want to pass it as a number (integer)

somefile.asp?psize=450

and either:
If you don't need a session variable (only a page variable) use
<% psize = CInt(Request.QueryString("psize")) %>
called on that page by
<%=psize %>
Of if you really need a Session variable (for more than 1 ASP page)
<% Session("psize") = CInt(Request.QueryString("psize")) %>
called on other pages by
<%=Session("psize")%>

--




| 1. Make all page with a .asp extensions if you plan to use sessions.
|
| 2. somefile.asp?psize=450px
|
| Then on next page:
|
| 3. Session("psize") = Request.QueryString("psize")
|
| --
| ==============================================
| Thomas A. Rowe (Microsoft MVP - FrontPage)
| ==============================================
| If you feel your current issue is a results of installing
| a Service Pack or security update, please contact
| Microsoft Product Support Services:
| http://support.microsoft.com
| If the problem can be shown to have been caused by a
| security update, then there is usually no charge for the call.
| ==============================================
|
| > HI! How do we pass a value in a link to a session variable?
| >
| > Is it like this for a string?
| >
| > somefile.htm?="450px"
| >
| > I am going to be using vbscript.
| >
| >
| > --
| > Thanks in advance :)
| >
| > Paul
| >
|
|
 
Thanks guys. I will try it. I am using it to adjust the iframe height size
for each page that gets loaded so it will be used by many pages. I also do
not want to refresh the first page as It holds a flash animation so I want
that to remain at its scene so I load the content into the iframe by a
JavaScript menu.

Paul
 
Back
Top