How do I use an asp:Button
or asp:LinkButton
as asp:Hyperlink
?
The existing Hyperlink just goes to another section on the same
There is a middle way. If you want a HTML control but you need to access it server side you can simply add the runat="server"
attribute:
Back
You can then alter the href
server side using Attributes
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
lnkBack.Attributes.Add("href", url);
}
}
resulting in:
Back