I have a Hyperlink my code, for which I want to provide "data-toggle"
HyperLink lnk = new HyperLink();
lnk.NavigateUrl = "somelink";
lnk.?? here I don't know how to give "data-toggle"
So that at the end I can have a link in the page as below:
<a data-toggle="modal" href="somelink"></a>
You can use Attributes collection, you can find more in How to: Set HTML Attributes for Controls in ASP.NET Web Pages
lnk.Attributes["data-toggle"] = "modal";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With