Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.93 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Run a javascript on postback in c#
  2. protected void Page_Load(object sender, EventArgs e)
  3. {
  4.     if (this.IsPostBack)
  5.     {
  6.         Page.ClientScript.RegisterStartupScript(this.GetType(),"PostbackKey","<script type='text/javascript'>document.getElementById('apDiv1').style.visibility = 'hidden';</script>");
  7.         Page.ClientScript.RegisterStartupScript(this.GetType(),"PostbackKey","<script type='text/javascript'>function show()</script>");
  8.     }
  9.     else
  10.     {
  11.         Page.ClientScript.RegisterStartupScript(this.GetType(),"PostbackKey","<script type='text/javascript'>document.getElementById('apDiv1').style.visibility = 'visible';</script>");
  12.     }
  13. }
  14.        
  15. protected void Page_Load(object sender, EventArgs e)
  16. {
  17.     if (this.IsPostBack)
  18.     {
  19.         Page.ClientScript.RegisterStartupScript(this.GetType(),"verify","<script type='text/javascript'>verify1();</script>");
  20.     }
  21.     else
  22.     {
  23.     }
  24. }
  25.        
  26. $( function() { ...my startup code... });