How to manually submit a button in asp.net using javascript?

By : mrblah
Source: Stackoverflow.com
Question!

Using javascript, I want to submit a asp.net button, how can I do this?

I know the onclick looks like: javascript:WebForm_DoPostBackWithOptions(new .....);

I am also weary because the ID of the control can change.

By : mrblah


Answers

You can either, click a button or submit a form.

So, if you want to click the button,

var button = document.getElementById('


Using jquery put something like this into your aspx page.

$('#


That is easy you can use __doPostBack function passing the controll ID that you want the click(command etc) event get fired.

To avoid problems with ID, do something like it:

__doPostBack("
By : Cleiton


This video can help you solving your question :)
By: admin