ASP.net: Retrieve PostBack sender (on Page_Load)


/ Published in: C#
Save to your folder(s)

Returns the postback sender ID. This is usually a button ID from a form that caused a post back.


Copy this code and paste it in your HTML
  1. /// <summary>
  2. /// Returns the sender ID of the post back received by ASP.net.
  3. /// (Usually a button's ID)
  4. /// </summary>
  5. /// <returns></returns>
  6. private string GetPostBackSender()
  7. {
  8. return Request.Params.Get("__EVENTTARGET");
  9. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.