Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
I am developing an ASP site with the code behind c#. I can't understand that how to write user-defined events for asp controls like panel, hyperlink and etc..
Here is My ASP Code..
ASP.NET
<asp:HyperLink ID="signUp" runat="server" CssClass="row5"> 
     <span>SIGNUP to </span>
     <br />
     <span>SEE</span>
</asp:HyperLink> 

In the above code the 2 span's have different style so that I cant remove it.. I want to write click event for this hyperlink. I thought that it should be like the following..
ASP.NET
<asp:HyperLink ID="signUp" runat="server" CssClass="row5" onclick="signUp_click"> 
     <span>SIGNUP to </span>
     <br />
     <span>SEE</span>
</asp:HyperLink>

The code behind..
C#
protected void signUp_click(object sender, EventArgs e)
  {
    panel1.Visible=true;
    panel2.Visible=false;
    signUp.Visible=false;
  }

Please do help me to write event for asp controls..
Posted

No click event for HyperLink Control.
If you want a click event then use LinkButton.
 
Share this answer
 
There is NevigateUrl property of Hyperlink you can use it to redirect to sign up page.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900