Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Adding webpage to silverlight application
7 replies. Latest Post by GearWorld on January 3, 2009.
(0)
philsal
Member
85 points
124 Posts
09-17-2008 9:14 PM |
I need to add a web page section into a silverlight application. That is the customer clicks a button and a news page gets presented from a generic http source. How do i do this?
sladapter
All-Star
17441 points
3,172 Posts
09-17-2008 10:30 PM |
You can not display a regular web page inside Silverlight control. But for user click a button in your Silverlight you could popup a new window to display the regular page.
Make your button a HyperlinkButton just like you use a A tag in HTML page:
<HyperlinkButton NavigateUri="YourPageURL" TargetName="_blank"/>
or use code:
HtmlPage.Window.Navigate(new Uri("YourPageURL", "_blank"));
If you do not like this approach, you could also use IFrame to display your regular web page. Set that IFrame style.position="absolute". Position that Iframe on top of your Silverlight control so it looks it embedded in your Silverlight control.
See this thread for more detail: http://silverlight.net/forums/p/15047/50272.aspx#50272
09-17-2008 11:12 PM |
Hi
I ended up using Component One to do it.
Thanks
GearWorld
Participant
844 points
1,104 Posts
01-02-2009 7:23 AM |
sladapter: You can not display a regular web page inside Silverlight control. But for user click a button in your Silverlight you could popup a new window to display the regular page. Make your button a HyperlinkButton just like you use a A tag in HTML page: <HyperlinkButton NavigateUri="YourPageURL" TargetName="_blank"/> or use code: HtmlPage.Window.Navigate(new Uri("YourPageURL", "_blank"));
Hi,
Is thre an option like _blank to open it in a new TAB instead of a new window ?
01-02-2009 10:48 AM |
I think that depend on your browser setting. You can set your browser to open links in a new tab instead of a new window while the code should be the same.
01-02-2009 8:32 PM |
Mine is set to open in a new tab and with _blank it opens int a new window.I tought there was something like _tab
01-03-2009 12:15 PM |
Which browser are you using? I just tested on both IE7 and Firefox. It always the link in a new tab when I set "Always open new pop-ups in a new Tab" in the Tabs setting.
01-03-2009 5:38 PM |
Hi Sladapter,
Why do your nick doesn't have a Capital letter ?
Sorry my fault. I mean, so SilverLight HyperLinkButton is acting like a popup and not a link because I had link set to new tab in IE 8 but pop was set to new window so I did set it for tab and it works. So I assume, clicking on a hyperlink acts like a popup :)