locked
how to use silverlight in an existing asp.net web page? RRS feed

  • Question

  • I am new to silverlight i want to know how to intergrate silverlight with an asp.net web page without altering its structure.

    Wednesday, November 23, 2011 11:37 PM

Answers

  • Hi. A Silverlight is embedded in an ASP.NET (or HTML) page using the object tag. That means that you can integrate it in existing pages quite easily and without changing any of the existing structure - you just have to find a place where you want to put the application into, or create a separate page that you link to. Here is the formal reference of the Silverlight object element and it's properties (in the tree view to the left), and here are the walkthroughs that show how to add Silverlight to an existing page. You can also create a new Silverlight project with a hosting web application in Visual Studio and then look at the source code of the generated HTML and ASP.NET pages to see how it's done.

    Thursday, November 24, 2011 12:30 AM

All replies

  • Hi. A Silverlight is embedded in an ASP.NET (or HTML) page using the object tag. That means that you can integrate it in existing pages quite easily and without changing any of the existing structure - you just have to find a place where you want to put the application into, or create a separate page that you link to. Here is the formal reference of the Silverlight object element and it's properties (in the tree view to the left), and here are the walkthroughs that show how to add Silverlight to an existing page. You can also create a new Silverlight project with a hosting web application in Visual Studio and then look at the source code of the generated HTML and ASP.NET pages to see how it's done.

    Thursday, November 24, 2011 12:30 AM
  • Just create a Silverlight application, and you will find out how the silverlight embeded in a asp.net page. something like this:

    <div id="silverlightControlHost">
            <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
    		  <param name="source" value="ClientBin/mysilverlight.xap"/>
    		  <param name="onError" value="onSilverlightError" />
    		  <param name="background" value="white" />
    		  <param name="minRuntimeVersion" value="4.0.50524.0" />
    		  <param name="autoUpgrade" value="false" />
    		  <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50524.0" style="text-decoration:none">
     			  <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
    		  </a>
    	    </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe>
    </div>
    Thursday, November 24, 2011 11:18 PM
  • <div id="silverlightControlHost"> <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%"> <param name="source" value="ClientBin/mysilverlight.xap"/> <param name="onError" value="onSilverlightError" /> <param name="background" value="white" /> <param name="minRuntimeVersion" value="4.0.50524.0" /> <param name="autoUpgrade" value="false" /> <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50524.0" style="text-decoration:none"> <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/> </a> </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe>
    </div>
    Hi,redstar,I confuse with the code that you given. Is it we can use this code in Source View and we can use Silverlight control?

    Wednesday, March 28, 2012 11:05 PM
  • <div id="silverlightControlHost"> <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%"> <param name="source" value="ClientBin/mysilverlight.xap"/> <param name="onError" value="onSilverlightError" /> <param name="background" value="white" /> <param name="minRuntimeVersion" value="4.0.50524.0" /> <param name="autoUpgrade" value="false" /> <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50524.0" style="text-decoration:none"> <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/> </a> </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe>
    </div>
    Hi,redstar,I confuse with the code that you given. Is it we can use this code in Source View and we can use Silverlight control?

    Wednesday, March 28, 2012 11:05 PM
  • I want to know what Silverlight is for. How the heck do you make it work, does it have an icon to spark it into life? All the technical stuff above leaves me out in the cold. Basically if it is of no use to me I want to uninstall it...anything to get rid of the blasted pop up in my Hotmail suggesting I install Silverlight when I already have it in there somewhere doing nothing. Bob Tomlinson.

    Sunday, September 30, 2012 3:20 PM