Reputation: 179
How can I use the webview Tool in C# in visual studio to create a windows 8.1 app (A simple web browser). I have tried these code and both of these don't work. I have worked with Visual Basic but am trying to move on to C#. I have tried these but none have worked in C#, please can someone help me out. Thanks.
Tried this, but didn't work
private void Page_Loaded(object sender, RoutedEventArgs e)
{
Webview1.Navigate(http://www.bing.com);
}
Also, tried this, which didn't work either
private void Page_Loaded(object sender, RoutedEventArgs e)
{
Webview1.Navigate(New Uri(http://www.bing.com));
}
Am I doing somethig wrong or is this code not for Visual Studio C#.
Thanks in advance.
Upvotes: 3
Views: 16224
Reputation: 36
You cannot put a Uri(string) without ("") at the sides of string reference, the code has not problem but the syntax yes.
Upvotes: 0
Reputation: 179
I figured out a short way of working with Webview :)
If anyone else is having a hard time on how to use webview in C#, this might help
WebView1.Navigate(new Uri(@"http://www.google.com"));
Upvotes: 7