Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. _EVENTTARGET

_EVENTTARGET

Scheduled Pinned Locked Moved ASP.NET
csharphelpquestion
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nick Seng
    wrote on last edited by
    #1

    AFAIK, Request.Params("_EVENTTARGET") is supposed to return the name of the control id that fired the postback. But in my VB.Net web app, it returns an empty string! Does this only work in C#?? Is there anyway I can find which control fired the postback? Notorious SMC


    The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning Mark Twain
    Get your facts first, and then you can distort them as much as you please Mark Twain

    N 1 Reply Last reply
    0
    • N Nick Seng

      AFAIK, Request.Params("_EVENTTARGET") is supposed to return the name of the control id that fired the postback. But in my VB.Net web app, it returns an empty string! Does this only work in C#?? Is there anyway I can find which control fired the postback? Notorious SMC


      The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning Mark Twain
      Get your facts first, and then you can distort them as much as you please Mark Twain

      N Offline
      N Offline
      Natty Gur
      wrote on last edited by
      #2

      It returns the name of the control id that fired the postback unless no one call the postback function. If a button is responsible for the postback the form will be submit without using the __dopostback.

      N 1 Reply Last reply
      0
      • N Natty Gur

        It returns the name of the control id that fired the postback unless no one call the postback function. If a button is responsible for the postback the form will be submit without using the __dopostback.

        N Offline
        N Offline
        Nick Seng
        wrote on last edited by
        #3

        So is there a way to find which button caused the postback? Notorious SMC


        The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning Mark Twain
        Get your facts first, and then you can distort them as much as you please Mark Twain

        N 1 Reply Last reply
        0
        • N Nick Seng

          So is there a way to find which button caused the postback? Notorious SMC


          The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning Mark Twain
          Get your facts first, and then you can distort them as much as you please Mark Twain

          N Offline
          N Offline
          Natty Gur
          wrote on last edited by
          #4

          Yes, just the button ID will be return with the Form to the server.

          N 1 Reply Last reply
          0
          • N Natty Gur

            Yes, just the button ID will be return with the Form to the server.

            N Offline
            N Offline
            Nick Seng
            wrote on last edited by
            #5

            but that's the thing. I've been trying to get the button ID with Request.Params("_EVENTTARGET") and all it returns me is an empty string. Am I doing something wrong? Notorious SMC


            The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning Mark Twain
            Get your facts first, and then you can distort them as much as you please Mark Twain

            N 1 Reply Last reply
            0
            • N Nick Seng

              but that's the thing. I've been trying to get the button ID with Request.Params("_EVENTTARGET") and all it returns me is an empty string. Am I doing something wrong? Notorious SMC


              The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning Mark Twain
              Get your facts first, and then you can distort them as much as you please Mark Twain

              N Offline
              N Offline
              Natty Gur
              wrote on last edited by
              #6

              The button ID should appear as a key in the Form collection. You should: Check the _EVENTTARGET for data. if the _EVENTTARGET is empty look in the key collection of the Form (Page.Form) for one of the buttons. If you found one of them, he is the responsible for the postback.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups