Can you tell me how can I provide a browser control in Windows 10 (WUP) XAML?
When I'm using WebControl I'm getting a compile error that says
WebBrowser is not supported in a Windows Universal project.
I have to show an "external" website, not a static HTML resource.
Universal Windows apps in Xaml use the Windows.UI.Xaml.Controls.WebView to display HTML content.
Xaml:
<WebView Source="http://stackoverflow.com" />
From code:
myWebView.Source = new Uri("http://stackoverflow.com");
From my experiences ,others then above you can go Package.app manifest changes the start page to the URL that you want .
Related
Is it possible to convert an existing XUL application to a pure web application without a complete rewrite? Are there any existing guides on doing this?
There is an existing project based on XUL / Mozilla Application Framework that I would like to see as a web application. But it seems that with FF4 this would no longer be possible.
You can use XUL Runner if you like to keep it like a desktop app or use the Ample SDK which supports XUL in HTML pages and it does a rendering using HTML and JavaScript.
I have an ASP.NET 1.1 app that does not work in IE10. When I try to navigate anywhere, I get a blank screen. The html of the blank screen looks like this:
<asp_smartnav_rdir url="/MyWebFormName.aspx"/>
I have seen the fixes for what sounds like a similar issue for .NET 2 through 4, but there is no App_Browsers folder in .NET 1.1.
The workaround that I settled on for this issue is to simply disable smart navigation. I wasn't using those features anyway. I'm not sure why it's broken in IE10 and not other browsers, but I can live without it.
I disabled it by setting smartNavigation="False" in the #Page directive of my aspx pages. It can also be programmatically set in the aspx.cs file by overriding the OnInit method and setting this.SmartNavigation = false.
Can you embed a IE web browser control in a C# XAML based Metro app on windows 8?
Also when doing so can the HTML/Javascript it it have the full featureset that a Windows 8 HTML app has,such as calling the WinRT apis?
There is a WebView control you can use to view websites or open html strings, but I believe to be able to communicate with the WinRT APIs you would need to relay the calls through the ScriptNotify events.
In the msdn docs it says in an HTML/CSS/JS Metro app an iFrame can be added to the page and website content can be loaded from a 'web context'
I would prefer to work in C#/XAML for this Metro app and I would just like it to encapsulate a website.
What is the correct method for displaying a website within a XAML page? Is there an equivalent of an iFrame in XAML? Can it be made full screen?
You can use the WebView class to display HTML content in a XAML app.
When I currently try I get the following error, even after adding google as a content URI
APPHOST9613: The App Host was unable to navigate to http://www.google.com/ due to the following error: FORBIDFRAMING.
Response from MSFT:
http://social.msdn.microsoft.com/Forums/en-US/winappswithhtml5/thread/a1cba639-3251-4df8-abd3-b6f6a95ba4ae
You can use Iframe,but you won't get full controll of their JS files,you may have to face some breaking point in such sites, and some sites like google blocking this facility.
Try this,
1. Make your default browser as IE10 which will provide you an App look for IE.
2. trigger an event
function openYourLink() {
var url = new Windows.Foundation.Uri("http://www.google.com")
Windows.System.Launcher.launchUriAsync(url);
}
You can use iframe to navigate to other pages.
<iframe src="http://www.apple.com" />
will do the trick.
However, not every website allows you to put their page in an iframe or they maybe using the top window layer so that their page doesn't support running in an iframe.
In addition, if you are running your code Visual Studio 11 Express, it may throw javascript exceptions in the web page in the iframe. You can "continue" it. This exception will not be visible when you are running a deployed version of your application (running from start menu).
On further investigation the answer seem to be that yes you can for most sites, but some sites (such as google) seem to fail when embedding with an iframe.