Alon M
Alon M

Reputation: 1683

Using times at asp.net webforms

i am trying to build a timer in my asp.net website.

so, when you click on a button, lets say hes id = "Button1." it will make the button disable(with enable = false command) and after few\4secconds it will enable=true again.

i have tired to look around how to to so, but all guilds online are very old.. and nothing is realyl helpfull.

This is the full code name(just for the exple):

protected void Button1_Click(object sender, EventArgs e)
    {

    }

Thanks alot! please help me :).

Upvotes: 0

Views: 70

Answers (2)

Burt
Burt

Reputation: 7758

Have a look at the following answer it should be what you are after:

Disable an asp.net dynamic button click event during postback and enable it afterwards

Upvotes: 1

Royi Namir
Royi Namir

Reputation: 148524

you cant do that in the server side. youll have to do it in client with setTimeout Js function with 4000 ms.

you have to understand that when you see the page - ther server doesnt know the page anymore. and he cant post back by himself.

Upvotes: 0

Related Questions