Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone,

Can anyone please tell me how to add hyperlink control dynamically for html table and how to add events for the same hyperlink.

Regards
Posted
Comments
Sunasara Imdadhusen 21-Feb-11 5:07am    
Using Javascript?
Sandeep Mewara 21-Feb-11 7:14am    
Repost?

If the table is static and you want to add the hyperlink at runtime then
XML
<table id="table1" runat="server">
        <tr><td id="td1" runat="server"></td>
        <td>failed</td></tr>
        </table>


C#
HyperLink hl = new HyperLink();
        hc.InnerText = "test test";
        hl.ID = "HID";
        hl.NavigateUrl = "/test.aspx";
td1.Controls.Add(hc);
 
Share this answer
 
Comments
Toniyo Jackson 21-Feb-11 6:12am    
good call.
Hope this[^] will help you.
 
Share this answer
 

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