---
title: "OnClick for Hyperlink"  
description: "OnClick for Hyperlink"  
author: "Mark Devid"  
published: 2014-11-28  
updated: 2014-11-29  
canonical: https://www.mindstick.com/forum/12718/onclick-for-hyperlink  
category: "asp.net"  
tags: ["c#", "asp.net"]  
reading_time: 1 minute  

---

# OnClick for Hyperlink

I'm new to ASP.NET and C# and also new to this forum but here is my problem. I'm [trying](https://answers.mindstick.com/qa/93698/6-mistakes-couples-are-trying-to-save-money) to create a [image gallery](https://www.mindstick.com/forum/12835/how-to-add-swipe-feature-to-a-image-gallery) with [ASP.NET Webforms](https://www.mindstick.com/forum/155702/difference-between-asp-dot-net-webforms-and-asp-dot-net-mvc)([requirement](https://yourviews.mindstick.com/view/85169/becoming-an-influencer-requirement-of-skills-and-knowledge)) and C#. I'm using a [Listview](https://www.mindstick.com/articles/12744/listview-in-android) to show the thumbnails and when you click on the small [picture](https://answers.mindstick.com/qa/38554/name-the-oscar-winning-sound-designer-who-became-the-first-asian-to-win-the-award-for-best-sound-for-documentary-india-s-daughter-at-the-coveted-motion-picture-sound-editors-63rd-annual-golden-reel-awards) the big [version](https://www.mindstick.com/articles/12845/things-to-remember-while-migrating-odoo-to-a-better-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](https://www.mindstick.com/articles/874/how-to-create-watermark-text-for-textbox-by-using-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>
```

## Replies

### Reply by Anonymous User

<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.


---

Original Source: https://www.mindstick.com/forum/12718/onclick-for-hyperlink

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
