OK so I have problem with sending data from my form to controller action
Its looks like this
My controller Action
[HttpPost]
public ActionResult Create(ProductsType products)
{
try
{
this.proxy.AddProduct(products);
throw new Exception("I am here 1");
return RedirectToAction("Index");
}
catch
{
throw new Exception("I am here 2");
return View();
}
}
My ExtJs Form
addProductForm = new Ext.FormPanel({
url: '../../Shop/Create',
width: 400,
autoDestroy: false,
autoHeight: true,
frame: true,
layout: 'form',
monitorValid: true,
items: [{..}]
buttons: [
{
text: 'Zapisz',
handler: function () {
addProductForm.getForm().submit({
waitMsg: 'Saving..',
success: function () { Ext.MessageBox.alert('Message', 'Ok');
addProductForm.getForm().reset();
},
failure: function () {
Ext.MessageBox.alert('Message', 'fail');
}
})
}
},
I'm not sure How can I get this (ProductsType product) object because now after compilation I'm in
catch
{
throw new Exception("I am here 2");
return View();
}
and when I checking values of object there is nothing only nulls and zeros