Skip to main content

Answered Question Silverlight in existing web pageRSS Feed

(0)

arvin1978
arvin1978

Member

Member

1 points

12 Posts

Silverlight in existing web page

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
Shaji-mji

Participant

Participant

1129 points

260 Posts

Re: Silverlight in existing web page

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

Mime Types 

rg10
rg10

Member

Member

72 points

16 Posts

Re: Silverlight in existing web page

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

 

arvin1978
arvin1978

Member

Member

1 points

12 Posts

Re: Silverlight in existing web page

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 ??

 

Shaji-mji
Shaji-mji

Participant

Participant

1129 points

260 Posts

Re: Silverlight in existing web page

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 Smile

arvin1978
arvin1978

Member

Member

1 points

12 Posts

Re: Re: Silverlight in existing web page

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

 

arvin1978
arvin1978

Member

Member

1 points

12 Posts

Re: Re: Re: Silverlight in existing web page

hi tried

 

<object data="data:application/x-silverlight," type="application/x-silverlight-app" width="100%" height="100%" >

<param name="source" value="silverlight/SilverlightApplication3.xap" />

 

</object>

 

nothing happens. just an x image

hiteshbhagwat
hiteshbh...

Participant

Participant

1265 points

287 Posts

Re: Re: Re: Silverlight in existing web page

Place your xap file in client bin folder if it is not there create it &

add following code in your aspx div

<div style="height:100%;">

<asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/SIlverlightApp1.xap" MinimumVersion="2.0.30523" Width="100%" Height="100%" />

</div>

Thanks & Regards
Hitesh

If this answer your que plz mark as answer

arvin1978
arvin1978

Member

Member

1 points

12 Posts

Re: Re: Re: Re: Silverlight in existing web page

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

hiteshbhagwat
hiteshbh...

Participant

Participant

1265 points

287 Posts

Re: Re: Re: Re: Re: Silverlight in existing web page

are you using silverlight 1.0 or silverlight 2.0 ?Bcoz silverlight 2.0 requires .net frame work 3.5 & VS 2008

Thanks & Regards
Hitesh

If this answer your que plz mark as answer

arvin1978
arvin1978

Member

Member

1 points

12 Posts

Re: Re: Re: Re: Re: Re: Silverlight in existing web page

am using silverlight2

dont have vs 2008, can try it in  .NET3.5 tough

a

Shaji-mji
Shaji-mji

Participant

Participant

1129 points

260 Posts

Answered Question

Re: Re: Re: Silverlight in existing web page

 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>

arvin1978
arvin1978

Member

Member

1 points

12 Posts

Re: Re: Re: Re: Silverlight in existing web page

worked great thanks

A

  • Unanswered Question
  • Answered Question
  • Announcement