Answered by:
webview

Question
-
hey!!!
im building an app in which i need to add google search..... like get the input string from text box and search it and display webpage in WEBVIEW...i dont know how to link textbox and webview..... thanks in advance
Friday, January 24, 2014 2:52 PM
Answers
-
This should be close. I'm not on a rev machine so it's untested.
void searchButtonClick(object sender, RoutedEventArgs e) { string searchString = textBlock1.Text; string searchBase = "http://www.bing.com/search?q="; URL searchURL = new URL(searchBase+searchString); myWebView.Navigate(searchURL); }
- Marked as answer by Rob Caplan [MSFT]Microsoft employee, Moderator Friday, January 24, 2014 6:48 PM
Friday, January 24, 2014 4:08 PMModerator
All replies
-
Here a suggestion:
if you search for "cars" in google the url will be "https://www.google.com/#q=cars&safe=images"
so i would suggest to navigate your webview to this url:
"https://www.google.com/#q=[YOUR-TEXT-FROM-THE-TEXTBOX]&safe=images"
Tariq
Friday, January 24, 2014 4:02 PM -
This should be close. I'm not on a rev machine so it's untested.
void searchButtonClick(object sender, RoutedEventArgs e) { string searchString = textBlock1.Text; string searchBase = "http://www.bing.com/search?q="; URL searchURL = new URL(searchBase+searchString); myWebView.Navigate(searchURL); }
- Marked as answer by Rob Caplan [MSFT]Microsoft employee, Moderator Friday, January 24, 2014 6:48 PM
Friday, January 24, 2014 4:08 PMModerator -
thanks guys ...... u know this link may select me as MSP!!!Friday, January 24, 2014 4:22 PM
-
sir can you help me out bing maps as well?
Friday, January 24, 2014 4:52 PM -
http://social.msdn.microsoft.com/Forums/en-US/f4d28fd4-e602-4e95-8b86-be70e4f3f167/bing-map?forum=bingmapswindows8#ff260f8e-fa0a-403e-859c-ad41b68f0c15Friday, January 24, 2014 4:53 PM
-
For help with Bing maps please post in the Bing maps forum (as it appears you did).
--Rob
Friday, January 24, 2014 6:48 PMModerator