Using Silverlight in Views in ASP.Net MVC is a Bad Idea?

I am currently writing a small application for internal use in my office. I started learning MVC myself (I was C # dev for 3 years). One of the basic requirements is editable grids - I quickly realized that Silverlight (I have zero experience with Silverlight) can be a big help with this. I managed to create proof of the concept of getting MVC and silverlight to discuss the fourth, combining these two methods: Creating the Rest API using MVC
MVC SilverLight
I also got some help on stackoverflow:
silverlight-grids-mvc-http-post

Essentially, all I do is embed an object with a silver light in the view. Serializing model data as JSON and passing it to silverlight (using intit params written in the response). The silverlight object can send data back to the controller as JSON.

So far, it seems that it can work very well. However, I’m a little worried that I could draw myself into a corner with this approach, since I don’t have much experience with any technology, so I worry that something further down the line will hit me that I won’t be able to work. Has anyone else tried to do this? Any advice would be highly appreciated!

+6
model-view-controller silverlight
source share
1 answer

I am using silverlight with ASP.NET MVC 2 for a few things that are simply simpler in Silverlight. At first, I thought it was wrong to combine a stateless structure with a state-dependent structure, but it certainly could work well. If your application is mainly Silverlight, you can not use MVC for it, but if you just use Silverlight when it is the right tool to work, I think it works fine.

You should not enter into any problems that simply will not work using two technologies. You can send data to and from Silverlight from MVC from MVC so you can send JSON results if you want. You can even embed a Silverlight object in a partial view, as you discussed. You can use http handlers to process Silverlight data. There is not much more.

Yesterday, I even wrote a post about using ASP.NET MVC 2 and Silverlight and how to make it more intuitive for people who are more familiar with the coding style in MVC. You can look at this if you decide to go with Silverlight in MVC.

+5
source share

All Articles