I was wondering about the following scenario:
I have a silverlight application that provides a navigation wrapper with cool transitions and visual effect for switching content. the silverlight application (lets call it: wrapperSL) has a RadHtmlPlaceHolders that the navigation loads a different aspx page into it when changed. Some aspx pages contain other silverlight applications.
The reason i use the place holder and not just make xaml pages and load them, is that the application becomes very large when including all of those xaml's, and i have alot of code and controls already written in asp.net ajax.
will this scenario work well? or will it slow everything down?
are there better ways of accomplishing this?
Is it wiser to have a bigger application size and have all the content in xaml's?
6 Answers, 1 is accepted
Quite right. Your version is 20Kb (mine was 1Mb... I broke my build from source by including local copy of all the DLLs referenced by RadEditorHelper) :)
Thanks for the replies.
you are correct that its not possible to reference the same page when loading from a SL APP an ASPX (into a RadHtmlPlaceHolder) that has the same SL APP imbeded because it creates an infinit loop if it loads the app right away.
But it is possible to reference the same SL APP if the RadHtmlPlaceHolder points for example to a site with a link to an ASPX with the same SL APP. if you click the link, you'll get the same SL APP in the RadHtmlPlaceHolder clicking it's link will get another SL APP and so on.
Step 3. Create a Silverlight web application
Step 4. Add Reference to SampleLibrary. After adding reference right-click on the SampleLibrary reference and change the property "Copy Local" to false. This will keeping the Assembly out of the XAP.
Step 5. Copy the assembly to ClientBin folder of web application where the .xap file resides.
Step 6. Add following to to load Assembly.
WebClient : Provides common methods for sending data to and receiving data from a resource identified by a URI.
Dim wc As WebClient = New WebClient()
AddHandler wc.OpenReadCompleted, AddressOf wc_OpenReadCompleted
wc.OpenReadAsync(New Uri("SampleLibrary.dll", UriKind.Relative))
After loading assembly from web server, AssemblyPart class's Load method loads it into the appdomain.
Public Sub wc_OpenReadCompleted(ByVal sender As Object, ByVal e As System.Net.OpenReadCompletedEventArgs)
Dim part As AssemblyPart = New AssemblyPart
If Not e.Result Is Nothing Then
Step 7. To use Strong Typing: Do not create the on-demand assempbly class object inside wc_OpenReadCompleted as silverlight's JIT complier will come in the way. When JIT compiler compiles wc_OpenReadCompleted method, it scans the method, finds that it references a type named "SampleClass" so tries to load "SampleLibrary.dll" so that reference can be resolved. Unfortunately, this happens before the method is even executed.
So always use the on-demand assembly classes in another method. In this way you can enjoy the benifits of strong typing
Public Sub UseClassLibrary()
Dim objSample As SampleLibrary.SampleClass = New SampleLibrary.SampleClass
Show.Text = objSample.SampleFunction()
i am facing issue to load the silver light in my aspx page.
i tested in my application for testing loaded only sliver light its working.
but when i use in my aspx page(i have lot of code) its not working not loading silver light.
i have written this code for load the silver light.
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="ClientBin/SilverlightApplication2.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="3.0.40624.0" />
<param name="autoUpgrade" value="true" />
<param name="Windowless" value="true" />
<param name="EnableHtmlAccess" value="true" />
<param name="initParams" value="DocSeqList=txtDocSeq" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&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"/>
</object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>