andrew Sullivan
andrew Sullivan

Reputation: 4084

Postback using javascript

How to cause a postback using javascript in ASP.NET.

Upvotes: 2

Views: 3634

Answers (2)

RationalGeek
RationalGeek

Reputation: 9609

Jacobnlsn is correct. However, if you want to do custom handling of the postback on the page as well, take a look at the IPostbackEventHandler interface.

http://msdn.microsoft.com/en-us/library/system.web.ui.ipostbackeventhandler.aspx

Upvotes: 0

Jacob Nelson
Jacob Nelson

Reputation: 3016

<script language='Javascript'>
__doPostBack('__Page', 'MyCustomArgument');
</script>

or if you just strictly want a postback you can send a null argument

<script language='Javascript'>
__doPostBack('__Page', '');
</script>

Upvotes: 4

Related Questions