Click here to Skip to main content
15,897,226 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to Use link Button in WPF in Windows Application.
Posted

Did you try googling "wpf linkbutton"? You would have gotten thousands of hits.
 
Share this answer
 
Hello,

Link button in ASP.NET at runtime works like a hyperlink, but you can write certain code with the use of a link button by generating its click event, in short the link button control looks like a hyperlink control but works like a button...

Here is some code that might help you out.

Take a label and a link button and then double click the link button to generate its click event and then use the code given below:

C#
protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Label1.Text = "You clicked a link button";
    }


Now when you click the link button the text of your label will be changed
Do rate my answer once you find it useful...

Thanks & Regards
Radix :rose:
 
Share this answer
 
v3
You can do this:

<TextBlock>
<Hyperlink NavigateUri=http://codeproject.com>CodeProject</Hyperlink>
</TextBlock>
 
Share this answer
 
Comments
radix3 20-May-10 6:28am    
Reason for my vote of 1
This is a small piece of code but i don't see the explanation, u could have explained your code to make the readers understand what you really mean by the above lines
Hi Neha,

Simply to answer your question, you can use the Click event on your link button to do the rest of your logic. This is not like ASP.NET to go directly to a page but you can do something like this by using the "PostBackUrl". If you want to add some client side script, yeah you can do that too by using "OnClientClick" property.

Please "Mark As Answer" if this information helped you.
 
Share this answer
 
v2
This link would help Link button in wpf[^]
 
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