How do you send an Ext.Net form to an MVC controller using client side code only?

StackOverflow https://stackoverflow.com/questions/7391674

  •  29-10-2019
  •  | 
  •  

Question

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 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

Was it helpful?

Solution

I dont know exactly what/where you are doing wrong, but please refer to this link to see an proper explanation of Ext.Ajax.request from sencha docs Sencha Ext.Ajax

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top