I want to make a Silverlight application in Expression Blend because of the rich UI and navigation of Blend. But I want to store the Silverlight application in an ASP.NET MVC web project. When I try to make a new Silverlight application, the default web application is an ASP.NET Web application (or web site, if I'm wrong). Can I make a single Silverlight application (no web project) then import in an ASP.NET MVC application? How can I do this?
+2
A:
Yes, you can.
- Create your Silverlight application without the web project.
- Add asp.net mvc project to the current solution.
- Go to the properties of you asp.net mvc project
- Select the Silverlight Application tab, click the Add button, and select the Silverlight project in the solution. Also specifiy the destination folder (in the asp.net mvc) where you want to place xap file.
- Create the view for you silverlight application.
- Reference your silvelight applicatition in the view. For example:
Code:
<object type="application/x-silverlight-2"
data="data:application/x-silverlight,"
width="100%" height="100%">
<param name="source" value="/ClientBin/MySlApp.xap"/>
<param name="onError" value="onSilverlightError" />
</object>
That's it...
Cheers
rrejc
2010-03-14 16:12:38