How do you send an Ext.Net form to an MVC controller using client side code only?
I need to submit a form on a form panel to the server using client side script alone.
The reason is that when form values change (event fires), I want to run a quick Ajax call to determine if a button on the panel should enabled/disabled. The problem is, that the already entered form data is significant for the server logic, so I need to send up the form data with the Ajax request for the server.
I don't want to simply send up the changed data item because there are complex fields on the form and this would require too much coding... so I want to re-use the already written server side code that updates business entities with form data.
I was working with something 开发者_C百科like this... although this fails completely.
Ext.Ajax.request({
url: 'controller/method',
form: formid.getForm(),
params: { id: '1' },
method: 'POST',
success: function (result) {btn.setDisabled(!Ext.decode(result.responseText).success); },
failure: function (result) { btn.setDisabled(false); }
});
Can anyone help? Thanks in advance
精彩评论