Results 1 to 6 of 6

Thread: How to display a local HTML file in Windows Phone 7

  1. #1
    Join Date
    Sep 2010
    Posts
    48

    How to display a local HTML file in Windows Phone 7

    I am using the windows phone from a long time and also do programs for that in the Microsoft Visual Studio 2010 Express. I had made a project which contains the HTML files and I added an HTML files to my project but the major problem here is that I am not able to open the project as well as the file. In addition to that I am not able to display it using the web browser that is the Internet explorer. So, please provide some suggestions on the given topic that will help to resolve the issue.

  2. #2
    Join Date
    Nov 2009
    Posts
    1,142

    Re: How to display a local HTML file in Windows Phone 7

    The problem that you have mentioned above can be resolve by using the NavigateToString() method in the emulator of the windows phone 7 which can be written in the Microsoft Visual Studio 2010 Express. These HTML files have to be pasted entirely in the code to get the effect. This is not a simple job and you require the basic knowledge of the HTML coding and the Microsoft Visual Studio 2010 as it requires you want to do some run time loading of local HTML files. So, by using the NavigateToString() method in the emulator you can get the HTML files loaded in your project that you want to run on the Windows Phone 7

  3. #3
    Join Date
    Sep 2010
    Posts
    48

    Re: How to display a local HTML file in Windows Phone 7

    Thank you for replying and providing the information but the method NavigateToString() that you have mentioned is not running in the simple emulator. It seems that there is a problem in the other codes that it will support so please provide me the other codes that are required for the HTML files to be loaded on the project. One of my professor told me that I have to use the Assembly.GetExecutingAssembly()method also to resolve the problem and there might be other methods also available for this problem to be fixed. So, provide a proper step by step solution to overcome the problem any suggestion will help.

  4. #4
    Join Date
    Nov 2009
    Posts
    3,331

    Re: How to display a local HTML file in Windows Phone 7

    To overcome the problem here is a code that you have to edit in the Emulator for the Windows Phone 7; in this you can load the HTML and then reading it and storing the same in a string. Note that we are not copying and then just pasting the code you have to write it in the editor of the emulator which is as below;

    Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("<Write_the_project_name>.File_that_you_wa nt_to_load.html");

    StreamReader reader= new StreamReader(stream);

    string html = reader.ReadToEnd();

    Browserweb.NavigateToString(html);

    This is the code that is required to load the HTML file in the project and then browse it in the Internet Explorer.

  5. #5
    Join Date
    May 2008
    Posts
    5,811

    Re: How to display a local HTML file in Windows Phone 7

    There is another method available for this problem to be resolved for that you have to follow some basic steps and your issue of the local HTML files not loading will be resolved;
    • First you need to fetch the HTML source files from the project that you have made in the Emulator of the windows Phone 7 and browse to the location where the required HTML file is located.

    • After that you need to call the Web browser’s method to execute the further issues.

    • Finally you need to call the NavigateToString () method to include the HTML file in the project that you are trying to run in the Windows Phone 7, this will for sure resolves the problem.

  6. #6
    Join Date
    May 2008
    Posts
    5,937

    Re: How to display a local HTML file in Windows Phone 7

    If you have use the above code and still not getting the proper solution then there is a part of the code that is missing which is as follows;

    StreamReader reader = new StreamReader(TitleContainer.OpenStream("MY_html_file_test.html"));
    Browserweb.NavigateToString(reader.ReadToEnd());

    This line of the code allow the emulator to read the code in a proper manner and then forward it to the local file that has to be uploaded in the project of the Windows phone 7 and after the execution of these code in the emulator you will get the HTML file laded and accessible through the Internet Explorer in the Emulator.

Similar Threads

  1. Blank icons of Opera file (htm, html) in Windows 7
    By MACALL in forum Technology & Internet
    Replies: 2
    Last Post: 26-08-2011, 05:23 AM
  2. Slow local network file transfer from Windows 7 to XP
    By aSITA in forum Networking & Security
    Replies: 5
    Last Post: 17-01-2011, 10:12 PM
  3. Will Internet Explorer support HTML 5 on Windows Phone 7?
    By Tarank in forum Portable Devices
    Replies: 4
    Last Post: 27-10-2010, 12:13 AM
  4. No Local Database in Windows Phone 7
    By UselessGuy in forum Portable Devices
    Replies: 5
    Last Post: 26-10-2010, 04:43 PM
  5. How to access Windows Vista local settings file
    By Kamran in forum Networking & Security
    Replies: 3
    Last Post: 02-06-2009, 08:01 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,749,979,878.44615 seconds with 16 queries