Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to raise a click event on a table? The following code is not triggering the event.

<asp:table id="ddd" runat="server" onclick="progressivedealers_click" style=" cursor:pointer; border:1px; margin-left:1px; background-color:Silver; margin-top:1px; border-color:red; border-bottom-style:groove; border-bottom-color:GrayText; border-bottom-width:thick;
width:568px; border-width:thick; height:178px" >
Posted
Updated 28-Nov-14 18:25pm
v2
Comments
Sergey Alexandrovich Kryukov 29-Nov-14 0:52am    
Why? .NET events can be only invoked in the declaring class; this is such a fool-proof feature. This is never really needed to invoke them from anywhere else.
—SA

I would suggest putting the click event on your rows or even on the cells depending on what you need. Some good examples are here: http://stackoverflow.com/questions/6816981/jquery-for-getting-click-event-on-a-table-row[^]
 
Share this answer
 
Hi,

if you are looking to have the server-side event fired once a click is made on any where in the table.. then its fairly easy; you just have to put the whole table client-script within an ASP hyperlink control and then add a onclick function to the server-side code.

if you want to have the same functionality then you have to add the hyperlink to each tag of the table you then will have the same functionality

please note that an ASP data repeater have to be used with all the above suggestion.

please let me know if i didn't get you correctly.

regards.
 
Share this answer
 
Comments
S.Rajendran from Coimbatore 2-Dec-14 0:49am    
My table is within a repeater and I have not put it in asp tag; it is in html tag.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900