Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with variable
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01152158
Message ID:
01152245
Views:
22
I think you need to make your field protected instead of private if you want to access it from the page events.

HTH,
Chad


>There is a private variable in my WebForm, it was assigned with value during Page.Load function. But when I try to get the value in button click event, it becomes null value, any advise would be appreciated, thanks.
>
>Here is my piece of code :
>
>
>Private myReference As String
>
>Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
>    AddNewRecord()
>End Sub
>
>Private Sub AddNewRecord()
>    Me.myReference = "ABC00001"
>End Sub
>
>Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdd.Click
>    ' Show null value ?
>    Msgbox(Me.myReference)
>End Sub
>
_________________________________
There are 2 types of people in the world:
    Those who need closure
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform