Professional Web Applications Themes

Which control causes postback? - ASP.NET General

"Stephajn Craig" <com> wrote in message news:phx.gbl...  You're usually better off just handling the "Click" event of all interesting controls, rather than looking at which one caused PostBack. -- John Saunders Internet Engineer com...

  1. #1

    Default Re: Which control causes postback?

    "Stephajn Craig" <com> wrote in message
    news:phx.gbl... 

    You're usually better off just handling the "Click" event of all interesting
    controls, rather than looking at which one caused PostBack.
    --
    John Saunders
    Internet Engineer
    com


    John Guest

  2. #2

    Default Re: Which control causes postback?

    Sure...__EVENTTARGET contains the control that raised the event...

    <input type="hidden" name="__EVENTTARGET" value="" />
    <input type="hidden" name="__EVENTARGUMENT" value="" />


    "Stephajn Craig" <com> wrote in message
    news:phx.gbl... 


    alien2_51 Guest

  3. #3

    Default Re: Which control causes postback?

    in addition to alien2_51 replay,

    If button cause the postback EVENTTARGET field will be empty since
    buttons submit form without using __dopostback. in this case the button
    name should be in the Request Form keys collection.

    Natty Gur, CTO
    Dao2Com Ltd.
    34th Elkalay st. Raanana
    Israel , 43000
    Phone Numbers:
    Office: +972-(0)9-7740261
    Fax: +972-(0)9-7740261
    Mobile: +972-(0)58-888377


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Natty Guest

  4. #4

    Default Re: Which control causes postback?

    Use,
    Request.Form(Me.postEventSourceID)

    Shaji

    "Natty Gur" <com> wrote in message
    news:O$phx.gbl... 


    Shaji Guest

  5. #5

    Default Re: Which control causes postback?

    Hi,

    I think it won't work since postEventSourceID is equaled to
    __EVENTTARGET and return null if button click.

    by the way postEventSourceID id static /shared data. Although VB let you
    use it with me you shouldnít. Me is the current object and you canít
    access static data from objects. Its actually working cause VB generate
    IL code that donít use the object. If you will try this code with C# you
    will get compilation error.

    Natty Gur, CTO
    Dao2Com Ltd.
    34th Elkalay st. Raanana
    Israel , 43000
    Phone Numbers:
    Office: +972-(0)9-7740261
    Fax: +972-(0)9-7740261
    Mobile: +972-(0)58-888377


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Natty Guest

Similar Threads

  1. get control properties after postback
    By mr. App in forum ASP.NET Building Controls
    Replies: 2
    Last Post: May 16th, 08:16 AM
  2. why does my control retain its value after postback
    By TS in forum ASP.NET Building Controls
    Replies: 1
    Last Post: August 3rd, 02:26 AM
  3. help with postback-less calendar control.
    By Ramakant in forum ASP.NET Building Controls
    Replies: 4
    Last Post: May 19th, 06:50 AM
  4. Postback failing in 1 control
    By CJ in forum ASP.NET General
    Replies: 4
    Last Post: August 27th, 01:01 AM
  5. control not found on postback
    By Igor Belagorudsky in forum ASP.NET General
    Replies: 3
    Last Post: July 29th, 04:05 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139