toll free: (866) 611-9441

How To Trigger "onclick" For A ASP.NET Controll On The Client Side

OK,

Let’s assume that we have a pop-up message triggered by a session timeout kind of event.
Like you should have for your online banking web application.

So, the message pops up reading that you have few more minutes to complete your online experience with that specific secured website.
Usually, if you don’t do anything about that, in about the same time it took the message to pop, the application will sign you out.

On the client side you have JavaScript for timing those actions.
Now, let’s say that the button that signs you out is called “btnSignOut”.
If you want to trigger the same action from a line of JS, on timeout, you should have something like this:

if(timeout){
<% =Me.Page.ClientScript.GetPostBackEventReference(btnSignOut, "") %>;
}

That will trigger the same event as by clicking on the “btnSignOut” linkButton.

Leave a Reply