0

I have a view with strong typed model. I have a popup (done with jquery slide) which some data from model. it has a button SEND which must send data to controller. Some of those requires validation (email for example). I also has some properties of model inside the view. They all together must be send to a controller.

How this can be done ? If possible some examples

Thank you

Alexander
  • 431
  • 2
  • 5
  • 19

1 Answers1

0

To send a partial data from your form, collect those information and send it as a JSON using jQuery ajax.

The MVC's built in JsonValueProviderFactory helps to bind JSON

$.post('/controller/action',{data:JSON.stringify(myData)},function(){


});
Murali Murugesan
  • 22,423
  • 17
  • 73
  • 120
  • ok, some questions: 1) this should be done in js func so i need to pass each model's property as parameter ? 2) what about validation. i need to check one for email, second is required. 3) there wont be any server-side validation ? – Alexander Jan 30 '14 at 11:44
  • @Alexander, The validation can be fired manually by calling a validate() method from jquery validate plugin – Murali Murugesan Jan 30 '14 at 11:48