Monday, November 30, 2009

LoadXap File Dynamically through HTML page

How to load xap file dynamically in silverlight?
We can use xap loader class method or else u can load xap file via html Page.Here is my example to load the xap file dynamically
Lets Create a sample application and bind the image in tat application .I have created the project in the name of sampleapplication .


Now i have created the other project name loadXAP to load sampleapplication XAP file.I have added MyPage.htm Page in the web project,and add the following code as in the image


and add div with the Id 'silverlightControlHost' in the body tag .Now place the sample application Xap file in the ClientBin folder of loadXap Application.Now i have place thumbnail of image and when i click on the image it redirects to MyPage.htm file with the XAP filename as Query string .Here is the screen shot of the application


No comments: