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.
HtmlPage object from within Silverlight to access the browser DOM to submit your form.WebClient or HttpWebRequest object. 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.INotifyPropertyChanged in 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.It sounds as if you're seeking a web service with Silverlight. The framework is relatively robust and easy to implement - once you dive in it should be no problem to get your web service up and running quickly.
http://silverlight.net/getstarted/
While you could have your Silverlight app post the HTTP form that surrounds it, you need to make sure that this is the proper implementation path for your problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With