Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Capture server event when a user clicks a <TD>?

Reply
Thread Tools

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

 
 
=?Utf-8?B?RGF2ZQ==?=
Guest
Posts: n/a
 
      02-08-2005
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
 
Reply With Quote
 
 
 
 
Frank Buchan
Guest
Posts: n/a
 
      02-11-2005
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:C24E057A-D1FB-410D-8AD8-...
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting event when user clicks X in browser, something different from {before}bodyunload hemant.singh@gmail.com Javascript 6 09-05-2006 06:07 AM
GridView _Sorting-event triggers twice every time user clicks on header Rolf Barbakken ASP .Net 1 09-03-2006 03:43 PM
capture checkbox clicks at server Josh Javascript 6 04-13-2005 11:50 AM
event from dynamically loaded usercontrol gets fired once for 2 clicks Dan ASP .Net 0 11-16-2004 03:22 PM
Clicks and double-clicks PontiMax ASP .Net Datagrid Control 2 07-14-2004 11:00 AM



Advertisments
 



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