lothos12345 Posted February 21, 2004 Posted February 21, 2004 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. Quote
Moderators Robby Posted February 21, 2004 Moderators Posted February 21, 2004 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 Quote Visit...Bassic Software
samsmithnz Posted February 21, 2004 Posted February 21, 2004 Or use the viewstate. Quote Thanks Sam http://www.samsmith.co.nz
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.