Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I deploy my silverlight .xap file to a document library.I'd like to add the silverlight using the object control,like below

param name="source" value="{SiteUrl}/SLDocLib/HelloWorldSilverlightApplication.xap"

but the SharePoint token {SiteUrl} doesn render as the current web url,I change the {SiteUrl} to ~site,it deos not render to the current site url as well, can anyone shine some light on this?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

why dont you put just the relative link in it? Then it will work in all zones, assuming that you have multiple zones. Than the {siteUrl} token is not needed. Apart from that, I believe that that token doesnt work, only works server-side(for example in masterpages, before the masterpage is rendered). If you check your web.config. If you really want to work this way, you might use some javascript (jquery/javascript client object model)

In addition to that: when using the SharePointclient-side object model in your silverlight application, it probably will not work. You need to load the xap via the silverlight webpart to make use of the current context. Otherwhise you may need to change your code and explicitedly open your SiteCollection by inserting the full URL.

share|improve this answer
    
Relative URL does the trick , thanks. –  Ybbest Jul 11 '11 at 4:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.