im really new to ASP.Net, and still havnt got my head around most concepts that really have problems with a variable when creating a desktop application, any variable created in the code, for example
int n = 10;
this variable will be there until the program runs correctly. but in asp iv, variables are created that should last until the user receives this page, so, for example, let's say I have a page that takes the value of the user (call this variable n, say, the user type is 10) and Each time the user clicks on the next button, the code will add 10 to this value. so the first time the user clicks the next button
n= n + 10;
what i found, no matter how many times i press the next button, n will always be equal to 20, because the previous value is not saved !!
these values ββare filled in when the user first visits this page, as soon as the user clicks on the next button, the contents of these values ββdisappear! how can this stop it?
hope it makes sense!
thanks
source share