locked
How do I navigate my browser to a html file in the app files? RRS feed

  • Question

  • I have the following code:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Animation;
    using System.Windows.Shapes;
    using Microsoft.Phone.Controls;
    
    namespace Metrodesktop
    {
        public partial class MainPage : PhoneApplicationPage
        {
            // Constructor
            public MainPage()
            {
                InitializeComponent();
            }
    
    
            private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
            {
                string site = ("Files/Metro Desktop.htm"); webBrowser1.Navigate(new Uri(site, UriKind.Absolute));
    
            }
        }
    }

    This is the mainpage onload. The web browser opens a page like "http:\\www.google.com" but i want it to link to a html file in my solution explorer contents. By the way the web browser doesn't need a button to be clicked as this is automatic. DO i need to use a path like 'C:\Windows\blah\blah.html?

    Saturday, October 19, 2013 10:15 PM

Answers

  • Please see this page:
    http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff402541(v=vs.105).aspx

    I'm moving this to the dev forums.


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.


    Monday, October 21, 2013 1:01 PM