Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with variable
Message
De
13/09/2006 11:58:49
 
 
À
13/09/2006 02:05:29
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:
01153387
Vues:
27
This message has been marked as the solution to the initial question of the thread.
The problem is because web pages are stateless. Your variable gets re-set back to it's original value with every post-back. This is normal behavior. After you set your variable in your addRecord method, you need to save it into a Session object so that it's persisted between post-backs.

~~Bonnie


>Hi Chad, sorry for confusing you.
>
>What I want is the addRecord calls whenever the page is NOT post back, else it will do other functions. The function called has no problem, and the value has been set as expected after the page load (without any user's action). I'm just confused that why the variable becomes NULL when I click a button to retrieve it's value which has been set in the Page Load function, thanks.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform