Click here to Skip to main content
11,928,078 members (44,982 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# .NET
Hi, Please any one help on this issue..Thank you for your help in advance,
Posted 16-Nov-11 19:46pm
AmolPandurangBorkar 17-Nov-11 0:56am
I think you need to improve your question.
What exactly you want is not clear...
Whatever source given for the hyperlink, that will get executed.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

hyperlink does not have a click event. You can use javascript hyperlink.[^][^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

According to my understanding you need to fire click event on Hyper Link where the event is not originally embedded with the control.

for do so you can use
<asp:HyperLink ID="HyperLink1" runat="server" onload="HyperLink1_Load">HyperLink</asp:HyperLink>

protected void HyperLink1_Load(object sender, EventArgs e)
          "javascript:alert('ALERT ALERT!!!')");
by registering new onclick event. but when ever click on the hyper link it will fire javascript function. so you can write logic inside the javascript function.

For me,i think there is alternative that you can use instead of Hyperlink.
Use Link Button. It looks exact like Hyper Link and you can fire server side Click event from the control it self.

<asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">LinkButton</asp:LinkButton>

protected void LinkButton1_Click(object sender, EventArgs e)
        //your code goes here 
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

HyperLink does not have a click event.

If you want click event you can use LinkButton.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.151126.1 | Last Updated 17 Nov 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100