Home > DeveloperSection > Forums > OnClick for Hyperlink
Mark Devid
Mark Devid

Total Post:102

Points:714
Posted on    November-28-2014 10:28 PM

 ASP.Net C#  ASP.Net 
Ratings:


 1 Reply(s)
 740  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:

 

<ItemTemplate>

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

</ItemTemplate>



Kamlakar Singh
Kamlakar Singh

Total Post:194

Points:1396
Posted on    November-29-2014 6:44 AM

<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.


Don't want to miss updates? Please click the below button!

Follow MindStick