views:

11

answers:

1

I've added a new silverlight application to my project. It works fine by itself.

I even have a ClientBin folder in my ASP.NET Web Application with the XAP file of my Silverlight project.

So how I embed that Silverlight project into my existing ASP.NET web application?

+1  A: 

Add the HTML markup from you default.aspx page in your Silverlight app to your .aspx page in your exisiting app. Something like this:

<object type="application/x-silverlight-2"      
    data="data:application/x-silverlight,"    
    style="position:fixed;height:100%; width:100%;">  
        <param name="source" value="ClientBin/YourXAPFile.xap"/>  
        <param name="minRuntimeVersion" value="3.0.40624.0" />
        <param name="autoUpgrade" value="true" />
     <div align="center" style="background-image:url(ClientBin/Icons/install_v1.png);height:100%;background-repeat:no-repeat;background-position:center;background-color:#666;padding:0">
        <div style="text-align:center;padding-top:300px;">
            <a href="http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=3.0.40624.0" style="text-decoration: none">
                <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight"
                    style="border-style: none" />
            </a>
        </div>
    </div>
</object> 

Your markup maybe slightly different depending on what version of Silverlight you are using and what params you may have added. If this works for you, you might also want to make a Visual Studio solution that contains both the exisitng ASP.NET web app and the Silverlight app and add the Silverlight app to the web apps Silverlight Applications list.

DaveB
Could you please help me with the related question? This is more of a extension to this question: http://stackoverflow.com/questions/3572468/help-with-nokolas-navseven-silverlight-navigation-bar
Silence of 2012