Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm having an issue trying to get my html code/javascript to display inside of a web browser control.
I don't have a phone to test on so I'm using the Emulator with VS2010 Ultimate.

I tried to use this site:
Site 1

I have added all of the folders and files and set the output to "Resource" in the solution explorer.

My code:
C#
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.Navigation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Resources;

namespace BitComposer
{
    public partial class EditPage : PhoneApplicationPage
    {

        public EditPage()
        {
            InitializeComponent();

        }

        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            Stream stream = Assembly.GetExecutingAssembly()
                 .GetManifestResourceStream("BitComposer.Editor.html");
            StreamReader reader = new StreamReader(stream);
            string html = reader.ReadToEnd();
            webBrowser1.NavigateToString(html);
        }
    }
}


I've also tried to navigate to the html page, still no luck.
Posted
Comments
Sergey Alexandrovich Kryukov 12-Sep-12 15:49pm    
How do I know that "BitComposer.Editor.html" is correct or not?
Why would it be in the Manifest? Why not using a regular .resx resource? Then you don't even need to use StreamReader (always unsafe), as there are auto-generated code with properties.
Just a note: software development is not a matter of luck. It is only if you use some existing code and try-and-error approach, which does not generally work.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900