With the templates coming out of VS2008 when you create a Silverlight application, a ASP.NET Web project is created for you to test your Silverlight app that adds the control into a ASPX page and a HTML page. Many developers will use the power of ASP.NET for server side processing and add a few ASP.NET controls on the page where the Silverlight control is.
There is when the user will find the problem about mixing up server side controls and Silverlight, the server side controls will cause postbacks that will refresh the Silverlight control. To avoid that problem, the developer may want to use MS ASP.NET AJAX to avoid the server side controls from doing a postback using the UpdatePanel. For this to work there is a simple modification that you need to do at the page where you are hosting the Silverlight control.
First drag and drop the ScriptManager on the page.
Second replace the location of the Silverlight.js file from:
<script type="text/javascript" src="Silverlight.js"></script>
To be hosted inside the ScriptManager like this:
<asp:ScriptManager ID="ScriptManager1" runat="server"> <Scripts> <asp:ScriptReference Path="Silverlight.js" /> </Scripts> </asp:ScriptManager>
Now all the controls hosted inside the UpdatePanels should work, remember not to add an UpdatePanel to wrap the Silverlight control.
Happy Silverlighting.
Cheers
Al
Follow me in twitter | bookmark me | Subscribe to my feed | Add stats to your blog


