问题描述
我在WebView类的webBrowser类中看到了Navigate方法的等价物是NavigateToString方法。但我看到我不能只使用字符串参数,如:
I saw that equivalent for Navigate method in webBrowser class in WebView class is NavigateToString method. But I saw that I can't use just string parameter like:
Navigation1.NavigateToString("www.google.com");
//Navigation1 is instance of WebView class
我得到运行时异常:
对象引用未设置为对象的实例。
I get runtime exception:
Object reference not set to an instance of an object.
我该怎么办?
顺便说一句,有关C#中Windows应用商店应用的好文献,我可以学习如何编写Blank应用程序,网格应用程序和拆分应用程序?
And btw is there any good literature for Windows Store Applications in C# where I can learn how to program Blank apps, Grid apps and Split apps?
推荐答案
您可能需要检查是否是"Navigation1"。正确。
You may need to check is the "Navigation1" correct.
一般来说,应该使用"webview.Navigate(Uri)"。到网络链接。
In general, should use "webview.Navigate(Uri)" to a web link.
例如。 Navigation1.Navigate(new Uri(" http://www.google.com"));
e.g. Navigation1.Navigate(new Uri("http://www.google.com"));
" NavigateToString"用于插入一些html段,
"NavigateToString" is for insert some html segment,
例如NavigateToString("< html>< body> ...< / body>< / html>");
e.g NavigateToString("<html><body>...</body></html>");
这篇关于WebView类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!