Feed Icon  


  • Bryant Likes
  • Send mail to the author(s) E-mail
  • twitter
  • View Bryant Likes's profile on LinkedIn
  • del.icio.us
Get Microsoft Silverlight
by clicking "Install Microsoft Silverlight" you accept the
Silverlight license agreement

Hosting By

Hot Topics


Open Source Projects



Switching XAP Files on the Client Side

Posted in Silverlight at Monday, December 22, 2008 12:15 PM Pacific Standard Time

qingquan126778 asked the question in the Silverlight forums about how to switch between pages in Silverlight if the pages are in different xap files. First I pointed to Jesse Liberty’s post on multi-page applications (qinqquan wanted different xap files, not just pages) and then Mike Snow’s post on swapping between xap files using the ASP.NET server control (qingquan wanted client side only).

So since neither one was quite right, I coded up an example of my own that is based off Mike’s example but uses client side scripting instead of server side. Basically you grab a reference to the Silverlight plugin control via the onLoad event and then just set the Source property to the new xap.

function App2()
    slCtl.Source = "ClientBin/SilverlightApplication2.xap";

Download Source Here

BTW – Did you vote on my 10k Content Entry yet? :)

Monday, December 22, 2008 2:44:27 PM (Pacific Standard Time, UTC-08:00)
What about downloading the xap file and loading it manually on SL.
Comments are closed.