Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want, to load a website based on a link label text.
I am currently using the following code to do so:

C#
LinkLabel input = (LinkLabel)sender;
        Process.Start("http://{0}",input.Text.ToString());



However when I click on a link, it just directs me to:

http://%7B0%7D/ which is not what I want it to do!

Any help is appreciated!

Dan
Posted
Updated 13-Aug-14 2:57am
v2
Comments
Herman<T>.Instance 13-Aug-14 8:58am    
Server.Decode() ?
Member 11010469 13-Aug-14 9:06am    
Can you be any more specific?

I use Visual Studio Express c#.net
Herman<T>.Instance 13-Aug-14 9:54am    
Start reading about it
Kornfeld Eliyahu Peter 13-Aug-14 9:11am    
I can't understand. What have you expected Process.Start will do?

Hi,

It looks like your string in not getting joined properly.

Try building the string via string.concat():

C#
Process.Start(string.concat("http://",input.Text.ToString()));



Hope it helps.
 
Share this answer
 
Comments
Member 11010469 13-Aug-14 9:32am    
Works, Cheers
Use Below Code

C#
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            LinkLabel input = (LinkLabel)sender;
            Process.Start("http://"+input.Text);
        }
 
Share this answer
 
v3

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