Hi everybody please help me on how to code this in C#.
I have an ASP.Net Web project and needs some C# code behind.
Working some variables:
In my VB.Net it looks like this:
Dim str1 as String
Private Sub Button1_Click(...)
str1 = "some text" 'This will be assigned to str1
End Sub
Private Sub Button2_Click(...)
'I will use the value of str1 here Ex.
Messagebox.Show("" & str1 &"")
End Sub
The string is declared outside the Sub so it can be accessed anywhere within the form.
how to do like that in C#?