How to make (link)button function as hyperlink?

前端 未结 5 1551
清酒与你
清酒与你 2021-01-17 08:49

How do I use an asp:Button or asp:LinkButton as asp:Hyperlink?

The existing Hyperlink just goes to another section on the same

5条回答
  •  隐瞒了意图╮
    2021-01-17 09:35

    The best way to accomplish this is by simply adding "href" to the link button like below.

    Button Text
    

    Using javascript, or doing this programmatically in the page_load, will work as well but is not the best way to go about doing this.

    You will get this result:

    Button Text
    

    You can also get the same results by using using a regular .

提交回复
热议问题