Aman
Aman

Reputation: 79

How to fire button click event from user contol in asp.net

I have a time on user control, and button on the web page. On perticular time I want to fire button click event. Please tell me how do this.

Upvotes: 1

Views: 1233

Answers (2)

eric.christensen
eric.christensen

Reputation: 3241

If you want the button clicked code to run after five seconds, for example, you would do the following.

setTimeout("document.getElementById(\"buttonId\").click();", 5000)

This link has basic information about timing in JavaScript.

It would be helpful if you could tell us more about the particular time-related user control you are using.

Upvotes: 0

Chinmayee G
Chinmayee G

Reputation: 8117

.click javascript method will help you.

document.getElementById("buttonId").click();

Upvotes: 2

Related Questions