2

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

andrew Sullivan
  • 3,834
  • 8
  • 30
  • 41

2 Answers2

4
<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>
Jacob Nelson
  • 2,880
  • 5
  • 30
  • 40
0

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

RationalGeek
  • 9,055
  • 11
  • 60
  • 90