Question about Code Behind and session variables 
Author Message
 Question about Code Behind and session variables

I am having trouble with Session variables and wondering if anyone has any
clues. Both pages are on the same server and domain. Below is a example of
my problem

Page1(Code Behind Snippet):
onFunction A(x as integer)

    if X > 99 then
        me.page.Session("xvar") = X
        me.page.response.redirect("pagea.aspx")
    Else
        me.page.Session("xvar") = X
        me.page.response.redirect("pageb.aspx")
    end if
end function

Pagea.aspx (in the ASP Script)
<!-- Other Html Here
-->
<%
    if Cint(Session("xvar") ) >99 then
        response.write("Welcome to Pagea")
    else
         response.redirect("page1.aspx")
    end if
%>
<!-- More Html here
-->
Pageb is same as page a except it outputs pageb instead of a.

In this above example the page always redirects to page1 even if X was >99.
Anyone care to give some light on why this is happening?

Ben Pyles



Thu, 25 Mar 2004 11:33:53 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Code-behind file inheriting from another code-behind file

2. Accessing SESSION variables in a VBScript block of code

3. ?? Re: Session Variable question?

4. Session Variable question?

5. Session Variable Question

6. Easy Question: Using Session Variables

7. How to set color coding w/o using code behind

8. How do I reuse code in the Code-Behind section of an ASPX page

9. Splitting Session Variable into several variables (array?)

10. Type mismatch when comparing session variable to page variable

11. Network Error - corrupted code behind form Access 2000

12. how do i put code behind a button

 

 
Powered by phpBB® Forum Software