problem when using sessions
-
hi every one, it's a very small thing. i'm using session don't know where was i gone wrong. pls help me.. :( IN PAGE1.ASPX
If CheckBox1.Checked = True Then Session("value") = "chkT"
IN PAGE2.ASPXDim check As String = Session("value") If (check = "chkT") Then some work code goes here Else another some work code goes here End If
and checkbox is given toAutoPostBack="True"
but the problem is when i run the application and checked the checkbox going fine and again without closing application when i checked off the checkbox i'm geting the result as the previous one only.. again when i close and start the application and now going without checking the checkbox, going fine, doing the work that should be if checkbox is not checked. but againg with out closing the application when i check the checkbox i'm getting the work as the previous one only i don't know where the wrong is. whether there is any syntax error? could you please help .. thanks in advance dittu -
hi every one, it's a very small thing. i'm using session don't know where was i gone wrong. pls help me.. :( IN PAGE1.ASPX
If CheckBox1.Checked = True Then Session("value") = "chkT"
IN PAGE2.ASPXDim check As String = Session("value") If (check = "chkT") Then some work code goes here Else another some work code goes here End If
and checkbox is given toAutoPostBack="True"
but the problem is when i run the application and checked the checkbox going fine and again without closing application when i checked off the checkbox i'm geting the result as the previous one only.. again when i close and start the application and now going without checking the checkbox, going fine, doing the work that should be if checkbox is not checked. but againg with out closing the application when i check the checkbox i'm getting the work as the previous one only i don't know where the wrong is. whether there is any syntax error? could you please help .. thanks in advance dittudittu7 wrote:
If CheckBox1.Checked = True Then Session("value") = "chkT"
Where in the page is this code written? On which event. Is this code running eveytime you click on checkbox? used Debugger? Further, what do you mean by 'without closing application when i check..."? You are on two different pages, right? Can you clear your work flow stepwise maybe.
-
hi every one, it's a very small thing. i'm using session don't know where was i gone wrong. pls help me.. :( IN PAGE1.ASPX
If CheckBox1.Checked = True Then Session("value") = "chkT"
IN PAGE2.ASPXDim check As String = Session("value") If (check = "chkT") Then some work code goes here Else another some work code goes here End If
and checkbox is given toAutoPostBack="True"
but the problem is when i run the application and checked the checkbox going fine and again without closing application when i checked off the checkbox i'm geting the result as the previous one only.. again when i close and start the application and now going without checking the checkbox, going fine, doing the work that should be if checkbox is not checked. but againg with out closing the application when i check the checkbox i'm getting the work as the previous one only i don't know where the wrong is. whether there is any syntax error? could you please help .. thanks in advance dittuR u writing this code on Page_Load() event. if yes, do the code under (! IsPostBack()) function. regards
Rating always..... WELCOME Be a good listener...Because Opprtunity knoughts softly...N-Joy