First create a project in Visual Studio.
Go to File => New => Project and select Blank App (Windows Phone).
Then make a HTML file and CSS file. Then write the code that you want to display in the Windows Phone App.
The following is the HTML page code:
- <html>
- <link href="design.css" rel="stylesheet" type="text/css" />
- <body>
- <p class="first">This is demo for HTML page in Windows Phone App</p>
- <p class="second">My Name is : NeErAj KuMaR</p>
- <p class="third">My Image :
- <img src="neeraj.jpg" class="img" />
- </p>
- <p class="fourth">
- <a href="http://www.twitter.com/sainipray" >Follow On Twitter </a>
- </p>
- <p>
- <a href="https://plus.google.com/u/0/+NeErAjKuMaR1234" >See my Profile on Google+ </a>
- </p>
- </body>
- <html>
- .first {
- background-color: Black;
- font-size: 20px;
- color: White;
- }
- .second {
- background-color: White;
- font-size: 30px;
- color: Black;
- }
- .third {
- background-color: GREEN;
- font-size: 20px;
- color: Yellow;
- }
- .fourth {
- background-color: Gray;
- font-size: 30px;
- color: RED;
- }
- .img {
- width: 100px;
- height: 100px;
- }

Create a folder in the Asset folder in Solution Explorer and copy the HTML and CSS files and one image to the new folder.

Then open the MainPage.xaml file and drag a ”WebView” element from the Toolbox to the Windwos Phone App GUI.
The following is the MainPage.xaml file code:
- <Page
- x:Class="HTMLAPP.MainPage"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:local="using:HTMLAPP"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d"
- Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
- <Grid>
- <WebView HorizontalAlignment="Left" Height="620" Margin="10,10,0,0" VerticalAlignment="Top" Width="380"/>
- </Grid>
- </Page>

Add code to the WebView event:
- private void WebView_Loaded(object sender, RoutedEventArgs e)
- {
- Web.Source = new Uri("ms-appx-web:///assets/HTML/demo.html"); ;
- }


Kumaresh RajalingamPosted Dec 31, 2015, 4:25 AM
Nice one
RakeshPosted Jul 28, 2015, 11:18 PM
Nice one
Santhakumar MunuswamyPosted Jul 28, 2015, 3:07 PM
Thanks for nice one
Vinodh NarayananPosted Jul 28, 2015, 2:02 PM
nice one
Gopi ChandPosted Jul 28, 2015, 10:43 AM
Good work
Sibeesh VenuPosted Jul 28, 2015, 7:52 AM
Nice Share
Pankaj Kumar ChoudharyPosted Jul 28, 2015, 7:36 AM
Nice Article Neeraj........
Rajeesh MenothPosted Jul 28, 2015, 7:26 AM
Good Article Neeraj Kumar
Nilesh JadavPosted Jul 28, 2015, 6:24 AM
Nice one sir