Event catching

  • Thread starter Thread starter Vadim
  • Start date Start date
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?
 
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','')">
 
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 = ?
 
Back
Top