asp.net - How can I use a page_load local variable in event handler of a button -


I am creating a site in Visual Studio using VB and I have a variable in Page_load, but the event of one The handler requires the value of the button to go to session.

Any suggestions on how I can do this? Any help is appreciated

You can store a value in the CommandArgument property of a button:

  btn.CommandArgument = "Your Value"  

and then you can remove it while handling the event:

  CType (Sender, Button).  

You can also create a new square that increases the button and create new properties below if you need several arguments:

  Class Season Button Inherits Button Grid DimSD Gid = None as a Public Property SessionBride () If nothing is the string. IISNullOrEmpty (ViewState ("Season") then s = New Good (Viewest ("Session"). ToString ()) Return & Get Set (By Value as Guitar) ViewState ("Sessionary") = Value Toastring () And Set End And Property And Class  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -