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: