OnClick for Hyperlink

Total Post:102

Points:714
C#  ASP.Net 
 1306  View(s)
Ratings:
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: 

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

  1. Post:194

    Points:1396
    Re: OnClick for Hyperlink

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

            NavigateUrl="http://stackoverflow.com/">HyperLink</asp:HyperLink>

    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.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!