Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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

share|improve this question
Solved sorry for interupt :P I had wrong fields name :< not like in model – Dox 13 hours ago

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.