|
-
Aug 9th, 2004, 07:49 PM
#1
Thread Starter
New Member
Problem with Session
Hi, i need help with a little problem about 'Session'
Look at this piece of code:
<@ Page Language="VB" EnableSessionState="True" >
<script runat="server">
Dim st As String
Sub Page_Load()
st="computer"
Session("mystring")=st
End Sub
Sub bt_click(o As Object, e As EventArgs)
Dim st2 As String = Session("mystring")
tbox.Text=st2
End Sub
</script>
<form runat="server">
<asp:Button id="bt1" onclick="bt_click" Text="..." runat="server" />
<asp:TextBox id="tbox" runat="server" />
</form>
When I click the button I´d like to see the word "computer" in the textbox, but nothing appears.
What is wrong in this code ?
what I really want is have the changes made to st in the page_load sub, available in the bt_click sub.
Is there a way to do this without using Session ?
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|