public variable

  • Thread starter Thread starter nicholas
  • Start date Start date
N

nicholas

why is this not working:

###### code #######
Public userlogin as String

Sub Page_Load(Sender as Object, e as EventArgs)
userlogin = request.form("userlogin")
response.write(userlogin) 'THIS WORKS !
End sub

Sub btn_step4_Click (sender As Object, e As System.EventArgs)

response.write(userlogin) 'BUT THIS DOES NOT

End Sub
###### code end #######

THX !
 
Hi, Nicholas!

Does it throw an exception? Do btn_step4 post the same form (or one
including a key named userlogin) that you use when the Page_Load code works?

Lars-Erik
 
found it.
I came from the previous page with server.transfer("...")
So, when I clicked on the button it went to the real page and than, that
request.form was empty.
So, the problem was not the way I use "public", but the way I transfered
variables.

THX anyway
 
Back
Top