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

G

Guest

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
 
F

Frank Buchan

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top