I never worked with Silverlight before, but I have the requirement to build a fairly dynamic/interactive form to fill out. That leaves me the choice between two technologies I have not much experience with: JavaScript/jQuery or Silverlight. (edit: The application is internal, I can safely assume Silverlight to be available)
At the end, I need to submit some data back to the server. I know that with a normal HTTP Form in ASP.net I can have a Button and an onClick Event – standard stuff. The JavaScript approach would include some DOM Manipulation to dynamically add/remove fields, but when I click on the button the current DOM gets served to my ASP.net Application and I process as normal. It is still a normal WebForms application.
But how would the interaction work with Silverlight? Can I have a Button in a Silverlight Application that essentially POSTs an HTTP Form? Or would I use a Web Service for this? It would be great if the Silverlight Application can get some data back from the server, so I guess it’s a web service then?
I suggest that you try out Silverlight to get a feel for how powerful that environment is. Personally I think that jQuery is nice, but you get a much more controlled and rich environment if you use Silverlight.
HtmlPageobject from within Silverlight to access the browser DOM to submit your form.WebClientorHttpWebRequestobject. Silverlight 3 has two HTTP stacks and the default is to use the browser stack ensuring that browser cookies (e.g. forms authentication cookies) are used in your request.INotifyPropertyChangedin the view-model you get a complex interaction logic if not for free at least in a way that is reasonable easy to handle as a developer. The partial client-side classes generated for you in .NET RIA Services are particular good candidates for view-models making it straightforward to apply the MVVM pattern within that framework.