Hi all,
My first time here. I'm quite the newbie when it comes to ASP after coding in VB6.
Frankly I'm stumped by something I'm sure should have a simple solution. Here's a very basic snippet of what I'm trying to do, so the problem (and hopefully the solution) is clear:
Partial Class _Default
Inherits System.Web.UI.Page
Public this As New Dictionary(Of Integer, String)
Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
this.Add(1, "This works")
End Sub
Private Sub Create_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Create.Click
this.Add(2, "This doesn't work")
End Sub
Private Sub Show_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Show.Click
MsgBox(this(1).ToString)
MsgBox(this(2).ToString)
End Sub
End Class
Is there an efficient way of using one button to pull in some data, then use another button to do something with it? It seems that anything I do within the button's procedure clears as soon as I come out of it.
Should I use something like a placeholder to put my dictionary into and access it that way? Or is that an inefficient way of dealing with this?
Any help greatly appreciated.