Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to open the webpage in my application.
for that i choose the WebView Control.
to open a page in webview
C#
Uri uri= new Uri("http://www.google.co.in");
wvBrowser.Navigate(uri);

wvBrowser.Source = uri;

we can use either
Quote:
wvBrowser.Navigate(uri);

or
Quote:
wvBrowser.Source = uri;

i tried both the methods. but webpage is not gets display.
how to show a webpage in metro style app (XAML with C#).
Posted

the above method works fine.
Please post the code which u r using so that v can help u.
 
Share this answer
 
Code Page :
C#
private void Button_Click_1(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            // TODO: Add event handler implementation here.
            if(txtAddressURL.Text.Trim()!=string.Empty)
            {
            try{
                Uri uri= new Uri(txtAddressURL.Text.Trim());
                wvBrowser.Navigate(uri);
            }catch(Exception ex){
            txtAddressURL.Text=ex.Message;
            }
            }
        }



Design Page :
<page>
    x:Class="FileExplorer.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:FileExplorer"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <grid background="{StaticResource ApplicationPageBackgroundThemeBrush}">
    	<textblock horizontalalignment="Left" margin="304.897,41.949,0,0" textwrapping="Wrap" text="Welcome to Integra !" verticalalignment="Top" height="63.569" width="500.671" rendertransformorigin="0.5,0.5" uselayoutrounding="False" d:layoutrounding="Auto" lineheight="24" fontsize="48" fontweight="Bold" xmlns:d="#unknown">
    	</textblock>
    	<webview x:name="wvBrowser" margin="42,161,0,10" horizontalalignment="Left" width="672" tooltipservice.tooltip="25" xmlns:x="#unknown" />
    	<button x:name="btnGo" content="Go" horizontalalignment="Left" margin="848,118,0,0" verticalalignment="Top" width="102" click="Button_Click_1" xmlns:x="#unknown" />
</grid>
</page>


the web page not yet display.
 
Share this answer
 

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