Is there any way to make a asp:hyperlink or asp:buttonlink control behave like a asp:button control for postback purposes (i.e., when click on the hyperlink it does a postback and fires a click event instead of doing the navigate function -- so that it can be the postback "button" for an updatePanel control)?
For example, I have an UpdatePanel control with a couple of buttons on it like so:
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:Table ID="Table1" BorderStyle="None" runat="Server">
<asp:TableRow>
<asp:TableCell ID="tcButtonCell">
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
<asp:Button ID="Button2" runat="server" Text="Button" OnClick="Button2_Click" />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
<hr />
<asp:Label ID="lblOutput" runat="server"></asp:Label>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</ContentTemplate>
</asp:UpdatePanel> With corresponding code-behind like this:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
lblOutput.Text = "Button 1 pushed"
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
lblOutput.Text = "Button 2"
End Sub
This updates the label without requiring the whole page to reload. What I would like to do is to replace the buttons with hyperlinks (so I don't have the button graphics to deal with and I can make the text look any way I want -- or maybe there's a way to do that with an asp:button?).