OnClick for Hyperlink

Total Post:102

C#  ASP.Net 
 1456  View(s)
Rate this:

I'm new to ASP.NET and C# and also new to this forum but here is my problem. I'm trying to create a image gallery with ASP.NET Webforms(requirement) and C#. I'm using a Listview to show the thumbnails and when you click on the small picture the big version should show above in a img tag for example. But I cant find any "OnClick" code for a hyperlink. Do I have to do that with JavaScript? Thanks for all help. 

here is some of the code: 

            <asp:HyperLink ID="ImageHyperLink" runat="server" ImageUrl='<%# Eval("Name","~/files/thumbs/{0}") %>' NavigateUrl='<%# Eval("Name","~/files/{0}") %>'></asp:HyperLink>              

  1. Post:194

    Re: OnClick for Hyperlink

    <asp:HyperLink ID="HyperLink1" runat="server"


    You will not get on click event for HyperLink, But for navigating on to the another page.

    You will get one property which is NavigateUrl

    By using this property you can redirect to any page by giving url.