How can I set focus to a hyperlink in asp.net? My hyperlink is in a repeater, and I want the item that is clicked to have focus.
Edit
This shows a lot of thumbnails. I want the thumbnail that is clicked to get focus.
<asp:Repeater ID="FileRepeater" runat="server" >
<ItemTemplate>
<asp:Image ID="Image" runat="server" />
<asp:HyperLink ID="HyperLink" runat="server" NavigateUrl='<%#"Default.aspx?image=" +
Eval("Name") %>' ImageUrl='<%#"Content/Thumbnails/" + Eval("Name") %>'>
HyperLink</asp:HyperLink>
</ItemTemplate>
</asp:Repeater>
If you are referring to an ASP.NET
LinkButtonbeing able to submit a form, this is not possible.A
LinkButtonrenders as a hyperlink, and cannot submit forms.I find
LinkButtoncontrols in general to be bad practice since these use javascript to be actioned, and don’t have any functionality when javascript is disabled.Your best option would be to use an ASP.NET
Buttonand then style this to look like a hyper link.