Re: Global Variable
- From: "Patrice" <nobody@xxxxxxxxxxx>
- Date: Wed, 22 Jun 2005 13:29:39 +0200
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
>
.
- References:
- Global Variable
- From: Shapper
- Global Variable
- Prev by Date: Re: Reset all form fields in code behind
- Next by Date: RE: ViewState vs Session
- Previous by thread: Re: Global Variable
- Next by thread: Re: Global Variable
- Index(es):