Capture server event when a user clicks a <TD>?

Discussion in 'ASP .Net' started by =?Utf-8?B?RGF2ZQ==?=, Feb 8, 2005.

  1. If I want to have the form submit when a user clicks on table cell as follows
    on a menu something like..

    <td style="cursor:hand;" onmouseover="this.style.backgroundColor='white'"
    onmouseout="this.style.backgroundColor='blue'" id="ProductList"
    onclick="__doPostBack('ProductList', '')">View Product List</td>

    Is checking the _EVENTTARGET in the Page_Load the only way to determine that
    it was clicked?

    If Request.Form("__EVENTTARGET") = "'ProductList'" Then ...

    Or can I somehow wireup the an event?

    Thanks
    =?Utf-8?B?RGF2ZQ==?=, Feb 8, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?RGF2ZQ==?=

    Frank Buchan Guest

    If you add the tags runat="server" and id="some_value" the TD can be treated
    as if it is a server side tag. Assigning a click is pretty straight-forward
    from that point, as it will behave as any other server-side element will.

    F Buchan

    "Dave" <> wrote in message
    news:...
    > If I want to have the form submit when a user clicks on table cell as
    > follows
    > on a menu something like..
    >
    > <td style="cursor:hand;"
    > onmouseover="this.style.backgroundColor='white'"
    > onmouseout="this.style.backgroundColor='blue'" id="ProductList"
    > onclick="__doPostBack('ProductList', '')">View Product List</td>
    >
    > Is checking the _EVENTTARGET in the Page_Load the only way to determine
    > that
    > it was clicked?
    >
    > If Request.Form("__EVENTTARGET") = "'ProductList'" Then ...
    >
    > Or can I somehow wireup the an event?
    >
    > Thanks
    Frank Buchan, Feb 11, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dan
    Replies:
    0
    Views:
    392
  2. Rolf Barbakken
    Replies:
    1
    Views:
    2,473
    sumu1234
    Sep 3, 2006
  3. PontiMax

    Clicks and double-clicks

    PontiMax, Jul 14, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    177
    Eliyahu Goldin
    Jul 14, 2004
  4. Josh

    capture checkbox clicks at server

    Josh, Apr 7, 2005, in forum: Javascript
    Replies:
    6
    Views:
    94
    Dr John Stockton
    Apr 13, 2005
  5. Replies:
    6
    Views:
    89
Loading...

Share This Page