Link to Google
-
Hi, I am new to silverlight, and have a little problem! I basically want to have a button and a textbox, and when the user presses the button it links to google and does a search on the text in the text box, so it calls "www.google.co.uk/search?q=" + TextBoxText The problem is when i put somthing like c# in the textbox, the # gets ignored. Mark
-
Hi, I am new to silverlight, and have a little problem! I basically want to have a button and a textbox, and when the user presses the button it links to google and does a search on the text in the text box, so it calls "www.google.co.uk/search?q=" + TextBoxText The problem is when i put somthing like c# in the textbox, the # gets ignored. Mark
The problem here is that your querystring text is actually malformed. C# is actually c%23 as far as a querystring goes. What you need to do is UrlEncode the text - you can use
HttpUtility.UrlEncode(TextBoxText);
to encode it (needs a reference to System.Web)."WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
-
The problem here is that your querystring text is actually malformed. C# is actually c%23 as far as a querystring goes. What you need to do is UrlEncode the text - you can use
HttpUtility.UrlEncode(TextBoxText);
to encode it (needs a reference to System.Web)."WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
-
You are welcome. :)
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.