Skip to main content

Microsoft Silverlight

Answered Question Adding webpage to silverlight applicationRSS Feed

(0)

philsal
philsal

Member

Member

85 points

124 Posts

Adding webpage to silverlight application

 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
sladapter

All-Star

All-Star

17441 points

3,172 Posts

Answered Question

Re: Adding webpage to silverlight application

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


 

sladapter
Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

philsal
philsal

Member

Member

85 points

124 Posts

Answered Question

Re: Re: Adding webpage to silverlight application

 Hi

I ended up using Component One to do it. 

 

Thanks

GearWorld
GearWorld

Participant

Participant

844 points

1,104 Posts

Re: Adding webpage to silverlight application

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 ?

 

sladapter
sladapter

All-Star

All-Star

17441 points

3,172 Posts

Re: Adding webpage to silverlight application

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.

sladapter
Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

GearWorld
GearWorld

Participant

Participant

844 points

1,104 Posts

Re: Adding webpage to silverlight application

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

 

sladapter
sladapter

All-Star

All-Star

17441 points

3,172 Posts

Re: Adding webpage to silverlight application

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.

 

sladapter
Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

GearWorld
GearWorld

Participant

Participant

844 points

1,104 Posts

Re: Adding webpage to silverlight application

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 :)

 

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities