简体   繁体   中英

How to open a Hyperlink in WebBrowser control in windows phone 7?

I have a Hyperlink button and web browser as below

<HyperlinkButton NavigateUri="{Binding Path=Link}" 
                 Content="{Binding Path=Title}" TargetName="webBrowser1"/>
<phone:WebBrowser Grid.Row="1" HorizontalAlignment="Left" Margin="12,0,0,12"  
                  Name="webBrowser1" Width="456" Visibility="Collapsed" 
                  Navigated="webBrowser1_Navigated" />

I want to open the link in web browser when i click on Hyperlink button.But when i click on Hyperlink button the webpage is opening in a new page ,i want it to open in webbrowser control of same page .Please help.
Thanks in advance

Add a handler to the click event of the HyperlinkButton.

In that event handler, call Navigate() on the WebBrowser control (passing the appropriate path).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM