Click here to Skip to main content
12,947,948 members (88,864 online)
Rate this:
 
Please Sign up or sign in to 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:
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 12-Sep-12 9:44am
shelby672.6K
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)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 5,344
CHill60 3,275
Maciej Los 2,628
Jochen Arndt 1,935
ppolymorphe 1,795


Advertise | Privacy | Mobile
Web02 | 2.8.170518.1 | Last Updated 12 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100