Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with variable
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
MS SQL Server
Divers
Thread ID:
01152158
Message ID:
01152245
Vues:
23
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform