Event catching

V

Vadim

There is a Table. When user clicks on a row of this table,
i need to recognize the clicked row on Server. It works
perfect with a Button control, but Table does not support
onClick event. What should i do?
 
P

PJ

I suppose you could use an onclick event on a <tr> element. Create a
linkbutton control anywhere in the page and set it's display style to none
<asp:linkbutton id="btnRow" runat="server" style="display:none">

on the row onclick event call __doPostBack for the button
<tr onclick="javascript:__doPostBack('btnRow','')">
 
V

vadim

Thanks!
I have already tried it. But there is another problem: i
build this Table dynamically on Server, so how can i
append this "<asp:linkbutton>" to <td>, i mean:
newRow.Cells[0].innerHTML = ?
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top