Click here to Skip to main content
15,891,714 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hello,

I have a WPF Application; which is borderless; has a close button only; is fully transparent including controls; has one text box; one button and a WebBrowser.

I am writing in Language C#:

I want users to have the ability to write there Username inside the TextBox and for username to be put into a link which will remain constant ie. www.examplewebsite.com/[UserNameHere]/websitecode/?#1336424lala

I want the Button to be able to tell the WebBrowser to load the above style link but grab the UserName from the TextBox and change the link for that user.

Button-->GetUsername-->Implement into link-->Browser load that link.

I know this is possible and I know it is an easy procedure I just haven't found it online.
Posted

1 solution

0) Make a Click event handler for the Button
1) In the Click even handler grab the username from the textbox
2) Make sure the username is valid (e.g. it's not an empty string)
3) Create the url using the username.
4) Use WebBrowser.Navigate[^]

I hope this helps you, as it's not really clear to me what exactly your problem is, except that you cannot get the WebBrowser to navigate to your url, solved i the 4th step
 
Share this answer
 
Comments
Hooolagon 14-Sep-11 16:14pm    
I found that using the (Uri) method on the left hand side panel was easier as it provides a clear example to which I had copied. Thanks

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