Button click problem in asp.net

Posted by Suneel161 under Regular Expressions on 8/26/2010 | Points: 10 | Views : 1331 | Status : [Member] | Replies : 1
I have a button in a page and when i click the button it ll start no of clicks on a button.when the page is loaded it is starting from 0 again.
It should not start from 0 when i click the button.
Help me out




Responses

Posted by: Vuyiswamb on: 8/26/2010 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
You need a Global variable for this , most of the time you can do this in the Global.asa ,

But the reason is that every time the page loads it will initialize the value. You can do it Global like this


http://imar.spaanjaars.com/223/howto-create-a-hit-counter-using-the-globalasax-file-in-aspnet-1x

instead of adding that code to a page load event, add it to your click event of your button

Thank you for posting at Dotnetfunda
[Administrator]

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response