Re: Global Variable

Tech-Archive recommends: Speed Up your PC by fixing your registry



1) Keep in mind that ASP.NET pages are created and disposed each time there
is an HTTP request i.e. members won't persist from one HTTP request to the
next (as this is not the same object that will handle both requests)...

2) If you already know this, make sure you set productid before using it.
For example it could be because events are not happening in the order you
expect. How is the "ProductID" member intialized ?

--

Patrice

"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> a écrit dans le message
de news:OviOJnrdFHA.720@xxxxxxxxxxxxxxxxxxxxxxx
> Hello,
>
> I am declaring a variable in my aspx.vb code as follows:
>
> Public Class catalogue
> Public productid As String
> Private Sub Page_Load
> ...
>
> I have an image button where I call the following function:
>
> Public Sub MyFunction(ByVal sender As Object, ByVal e As
> CommandEventArgs)
>
> Response.Write(productid)
> Response.Write(e.CommandName)
>
> End Sub
>
> I can see the e.CommandName value but not the productid.
>
> Is not productid global the way I declare it?
>
> Thanks,
> Miguel
>


.


Quantcast