Asp.net Hyperlink control equivalent to

前端 未结 6 1235
眼角桃花
眼角桃花 2021-02-06 23:35

I wanted to define a HyperLink control in asp.net that produces html output similar to the following:


but can\

6条回答
  •  礼貌的吻别
    2021-02-07 00:41

    If you need to access this as a server-side control (e.g. you want to add data attributes to a link, as I did), then there is a way to do what you want; however, you don't use the Hyperlink or HtmlAnchor controls to do it. Create a literal control and then add in "Your Text" as the text for the literal control (or whatever else you need to do that way). It's hacky, but it works.

提交回复
热议问题