Question - When to use Silverlight, ASP.NET, or both?
Answer -
This depends on different scenarios. Below are some common approaches:
• Pure Silverlight One approach is to completely remove ASP.NET. This solution works best if you’re working on a new development. You only need to work on Silverlight, without any worry about integration problems. If you need to communicate with the server, you write Web Services, such as WCF. It will also help you when you need to port part or whole of your system to another hosting or even another platform, since the client and the server are completely separate.
• Major ASP.NET, plus a Silverlight island This approach is generally used when the Silverlight content and the ASP.NET content have little relationship. For example, an ASP.NET blog engine with a Silverlight media player in a blog post. This approach is very easy to implement, and allows you to reach the broadest audience. For example, if a user hasn’t installed Silverlight, he can still read the blog posts, but he can’t watch the videos.
• Use ASP.NET AJAX instead of Silverlight ASP.NET AJAX is designed to work with ASP.NET. It is mainly an extension to ASP.NET. While AJAX can’t provide you the advanced user experience that Silverlight can, for many scenarios, it should be sufficient. This approach also helps if you have strong ASP.NET experience, but are still quite new to Silverlight. Within this approach, there are two branches. One is to mix the client and server code by using the UpdatePanel, AJAX Control Toolkit, and etc. The other method is to take the pure AJAX approach, where you write HTML and JavaScript instead of using server controls, and call Web Services to communicate with the server. The former branch is easier to implement, especially if you have strong ASP.NET experience but lack JavaScript knowledge. The latter branch proves to be better in an architecture when you want to port an AJAX application to other technologies such as Silverlight, especially since you only need to rewrite the client side code, and can keep the Web Services as they are. The programming model for the latter branch is similar to Silverlight. Therefore, this approach is rarely taken if you’re experienced in Silverlight.
• Mix Silverlight with ASP.NET More often, you may want to port an existing ASP.NET application to Silverlight, but you don’t want to completely rewrite the entire application. This is the most difficult approach since you’re mixing client side and server side technologies. Before going with this approach, please consider if the above approaches can solve your problem.