Click here to Skip to main content
15,887,344 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have button, so when i click on it, i want to display a web page for example

when i hit the button , it should open google home page

so how do i add www.google.com hyperlink to the button?

please can anyone provide me a solution in C#?
Posted

The simplest way is adding the following to your button OnClick handler:
C#
Process.Start("http://www.google.com");
 
Share this answer
 
Comments
dan!sh 13-May-14 1:42am    
Ah, I just thought you were being creative with asking OP to search.
Mehdi Gholam 13-May-14 1:48am    
Nooooo, I would never do that!
Hi,

Add attribute "NavigateUri" as stated below :

XML
<HyperlinkButton Name="MyHyperlink" ClickMode="Press" Content="AutoCompleteBox"   Foreground="Blue" FontFamily="Arial" FontSize="15" NavigateUri="http:\\www.google.com">
</HyperlinkButton>


Thanks,
Bh@gyesh
 
Share this answer
 
Comments
Member 10593922 13-May-14 1:46am    
Thank u all for the reply.
Member 10593922 13-May-14 1:47am    
So in case if i want to display the same hyperlink content in a textbox box how should i do?
Bh@gyesh 13-May-14 1:48am    
I dont understand your question. Does it mean you want to open google.com in textbox?
Member 10593922 13-May-14 1:53am    
yes.. so what ever link am passing on click of a button, instead of displaying the hyperlink contents in a web page, i want it to be displayed in a textbox. so how can i do that?
Member 10593922 13-May-14 1:55am    
see i have a button which contains a hyperlink. And a multi line textbox below the button.
so i want to display the hyperlink contents in the text box on click of a button instead of displaying in the new web page

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