Advertisement
Guest User

Untitled

a guest
May 14th, 2012
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. How to excute some code only for the first asp:button click
  2. protected void Button1_Click(object sender, EventArgs e)
  3. {
  4. if (Session["Clicked"] == null)
  5. Session["Clicked"] = true;
  6. else {
  7. // We already ran this function once, so do other stuff from now on
  8. ...
  9. return;
  10. }
  11.  
  12. // Code below this comment will be executed only on the 1st button click
  13. ...
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement