Posted By

blackf0rk on 05/17/10


Tagged

Net postback


Versions (?)

Cause a Postback in .NET


 / Published in: C#
 

This code will execute a postback.

  1. private void FirePostBack()
  2. {
  3. StringBuilder sbScript = new StringBuilder();
  4. sbScript.Append("<script language='JavaScript' type='text/javascript'>\n");
  5. sbScript.Append("<!--\n");
  6. sbScript.Append(ClientScript.GetPostBackEventReference(this, "PBArg") + ";\n");
  7. sbScript.Append("// -->\n");
  8. sbScript.Append("</script>\n");
  9. ClientScript.RegisterStartupScript(GetType(), "AutoPostBackScript", sbScript.ToString());
  10. }

Report this snippet  

You need to login to post a comment.