Cause Postback from Javascript


/ Published in: ASP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <input type="button" id="Button2" value="Press me" onclick="DoPostBack()" />
  2. <script language="javascript" type="text/javascript">
  3.  
  4. function DoPostBack()
  5. {
  6. __doPostBack('Button2','My Argument');
  7. }
  8.  
  9. </script>
  10. string passedArgument = Request.Params.Get("__EVENTARGUMENT");

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.