Iti Tyagi
Iti Tyagi

Reputation: 3671

Fire OnclientClick after Onclick for asp.net button control

Is it possible to fire the onclientclick after the onclick event for asp.net button? I am sending some values in session from onclick event and then I want to fire onclientclick. Any help would be advisable.

Upvotes: 1

Views: 4584

Answers (2)

Binoy Jose
Binoy Jose

Reputation: 21

Are you using an Update Panel? If yes, capture the endrequest and write code there..

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequest);

Upvotes: 2

vendettamit
vendettamit

Reputation: 14687

You can call the javascript function using register client script inside the onclick of the button.

    ClientScript.RegisterStartupScript(Page.GetType, "Javascript", 
"YourButton_OnClientClick_Handler();", true);

Upvotes: 2

Related Questions