Asp.net - 如何将按钮转换为超链接

Beg*_*ner 5 vb.net asp.net

我想要一个人点击购买,这会触发代码隐藏中的代码.

这与a工作正常Button,但我更喜欢文本超链接?

    <asp:Button runat="server" ID="purchase" Text="Purchase" />
Run Code Online (Sandbox Code Playgroud)

Jim*_*uts 11

LinkBut​​ton怎么样?LinkBut​​ton基本上为您提供了一个asp:Button作为超链接.

<asp:LinkButton runat="server" ID="purchase" Text="Purchase" />
Run Code Online (Sandbox Code Playgroud)

有关更多信息,请参阅MSDN.