Skip to main content
Microsoft Silverlight
Home Forums General Silverlight Getting Started Silverlight in existing web page
12 replies. Latest Post by arvin1978 on August 10, 2008.
(0)
arvin1978
Member
1 points
12 Posts
08-06-2008 2:12 AM |
hi i have created a test silverlight application (a textbox transform) using web blend 2 and its working fine
now i would like to include this silverlight plugin within a div of my existing aspx page (created using VWD 2008). I cant get it working. no error showing
what am doing wrong? do i need VS 2008 edition?
any suggestion much appreciated?
Thanks
Shaji-mji
Participant
1129 points
260 Posts
08-06-2008 2:23 AM |
You can embed the silverlight application in any webapplication. You dont need VS2008 for that.
Place the xap file in the web folder and add it to ur aspx page and add the mime types for silverlight to work in IIS, you can get the details of the mimetypes to be added in the following link
http://picasaweb.google.co.in/shajimji/Misc/photo#5226085542644260962
rg10
72 points
16 Posts
08-06-2008 3:03 AM |
Hi,
You don't necessarily have to do it with VS 2008.
I have done something similar with Visual WebGui which is a framework over VS and it allows Silverlight and DHTML to integrate and interoperate in a very simple way.
www.visualwebgui.com/silverlight
08-06-2008 3:07 AM |
Thanks shaji
IS XAP file can be created using Blend? when i created the silverlight project in blend it created 2 JS files, html page and xaml file. I tought i can include the js files , xaml files in aspx page ??
08-06-2008 3:25 AM |
when you build the app from blend there will be a xap file generated in the \Bin\Debug folder. You can use that. there is no need of any other files
08-08-2008 1:54 AM |
hi shaji,
Thanks for the reply. I able to create the xap file using blend 2.5 june preview.
I edited iis6 to include xap mime type
now how can i add the xap in the aspx page which displays the silverlight animation within the div?
i couldnt find any article.
Note- am using vwd2008 to create the website
thanks
08-08-2008 2:06 AM |
hi tried
</
nothing happens. just an x image
hiteshbh...
1265 points
287 Posts
Place your xap file in client bin folder if it is not there create it &
add following code in your aspx div
<
08-08-2008 2:16 AM |
hitesh
i am using Visual Web Developer 2005
when i placed your code, i get the parse error
Unknown server tag 'asp:Silverlight'.
do i need to reference any DLL?
A
08-08-2008 2:27 AM |
are you using silverlight 1.0 or silverlight 2.0 ?Bcoz silverlight 2.0 requires .net frame work 3.5 & VS 2008
08-08-2008 2:58 AM |
am using silverlight2
dont have vs 2008, can try it in .NET3.5 tough
a
08-08-2008 3:18 AM |
try this code
<script type="text/javascript"> function onSilverlightError(sender, args) { if (args.errorType == "InitializeError") { var errorDiv = document.getElementById("errorLocation"); if (errorDiv != null) errorDiv.innerHTML = args.errorType + "- " + args.errorMessage; } } </script>
<object data="data:application/x-silverlight," type="application/x-silverlight-2-b1" width="100%" height="100%"> <param name="source" value="ClientBin/Test.xap"/> <param name="onerror" value="onSilverlightError" /> <param name="background" value="white" /> <a href="http://go.microsoft.com/fwlink/?LinkID=108182" style="text-decoration: none;"> <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/> </a> </object>
08-10-2008 8:52 PM |
worked great thanks