Sender object?

Results 1 to 2 of 2

Thread: Sender object?

  1. #1
    Join Date
    Dec 1969

    Default Sender object?

    On my form I have server controls that generate PostBack events (Buttons, DropDownList). In my Page_Load(object Sender, EventArgs e) procedure I would like to know which server control caused it. I do:<BR>if (Sender is DropDownList)<BR>{...}<BR>if (Sender is Button)<BR>{...}<BR>if (Sender is Page)<BR>{....}<BR>But I alwayes get that Sender is a Page object (even if the Button generates the PostBack).<BR><BR>Does somebody know what I do wrong and how can I check what server control generates the event?

  2. #2

    Default RE: Sender object?

    try response.write sender.gettype().FullName

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts