Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I have declared an integer outside the private sub statement. So it will hold it value after the event has been executed. This works fine in Window Applications, however this does not seem to work in webforms. Is there away in VB.NET for webforms that I can make a variable keep its value after an event has beem executed? Any help with this question would be greatly appreciated.
  • Moderators
Posted

You can assign the value to a Session object.

dim temp as string = "hello"

Session("SomeVar") = temp

'then after postback you can get its value like this....

dim temp as string

if not Session("SomeVar") is nothing then
    temp =  convert.tostring(Session("SomeVar"))
end if

Visit...Bassic Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...