Skip to main content

Microsoft Silverlight

Answered Question Positioning Silverlight ElementsRSS Feed

(0)

ddni_nk
ddni_nk

Member

Member

6 points

53 Posts

Positioning Silverlight Elements

So I finally figured out how to get silverlight elements onto my existing html webpage, but now I'm having trouble positioning them where I want them.

Any ideas on how I can place my silverlight element where I want it on the html page?

 

SharpGIS
SharpGIS

Contributor

Contributor

3387 points

611 Posts

Re: Positioning Silverlight Elements

Placing the Silverlight object on the webpage is no different than placing any other HTML element.

Could you be more specific?

--
/Morten | blog - twitter
Please click on "Mark as Answer" if this answered your question.

Jonathan Shen – MSFT
Jonathan...

All-Star

All-Star

24939 points

2,425 Posts

Microsoft
Answered Question

Re: Positioning Silverlight Elements

Hi Ddni_nk,

ddni_nk:
Any ideas on how I can place my silverlight element where I want it on the html page?

Silverlight elements shall show inside the Silverlight plugin. 

As we know, Silverlight can interact with Javascript easily.  In your condition, if you want reposit the Silverlight elements when a HTML element's event is raised. We'd better use Javascript to call a Silverlight method.  And in this method, we can change its position. 

Here are two useful links.

Calling Javascript functions from Silverlight 2

Call Scribtable Methods from JavaScript with Silverlight

Best regards,

Jonathan

Jonathan Shen
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

paru
paru

Member

Member

164 points

28 Posts

Re: Positioning Silverlight Elements

When you build the application your silverlight.xap file will be there in you ClientBin.

Then in your Default.html or testpage.aspx or in any page u require.

<div id="silverlightControlHost">
  <object data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%"/> 

 

 

 

Mark if it answers :)

Thanks
Paru

--mark as answer if helped
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities