Skip to main content
Home Forums Silverlight Design Designing with Silverlight Positioning Silverlight Elements
3 replies. Latest Post by paru on July 2, 2009.
(0)
ddni_nk
Member
6 points
53 Posts
06-26-2009 1:39 PM |
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
Contributor
3387 points
611 Posts
06-26-2009 11:40 PM |
Placing the Silverlight object on the webpage is no different than placing any other HTML element. Could you be more specific?
Jonathan...
All-Star
24939 points
2,425 Posts
07-01-2009 6:16 AM |
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
paru
164 points
28 Posts
07-02-2009 5:24 AM |
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 :)