[CLOSED] [MVC] Get values from HttpPost methodes

  1. #1

    [CLOSED] [MVC] Get values from HttpPost methodes

    Hi,

    I have the same question as http://forums.ext.net/showthread.php...-of-controller

    But your answers in that post is not very clear.
    Can you give me a example showing how to get values from the Views in the Controllers through HttpPost methode?

    Thank you
    Last edited by Daniil; Jul 10, 2012 at 11:23 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Do you need to use a common HTML <form> or a <ext:FormPanel> control?
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    Do you need to use a common HTML <form> or a <ext:FormPanel> control?
    If possible, can you use Ext FormPanel with Razor. :)
  4. #4
    Here you are.

    Example View
    <!DOCTYPE html>
    
    <html>
    <head>
        <title>Ext.Net.MVC v2 Example</title>    
    </head>
    <body>
        @Html.X().ResourceManager()
    
        @(Html.X().FormPanel()
            .Url("/Razor/Submit")
            .Width(300)
            .Items(items =>
                {
                    items.Add(Html.X().TextField().ID("TextField1").Text("Value 1"));
                    items.Add(Html.X().TextField().ID("TextField2").Text("Value 2"));
                }
            )
            .Buttons(buttons =>
                buttons.Add(Html.X().Button()
                    .Text("Submit")
                    .Listeners(ls =>
                        ls.Click.Handler = @"this.up('form').submit({ 
                                                 success : function (form, action) {
                                                     eval(action.result.script);
                                                 }
                                             });"
                                    )
                )
            )
        )
    </body>
    </html>
    Example Controller Action
    public ActionResult Submit(FormCollection values)
    {
        FormPanelResult r = new FormPanelResult();
        r.Script = string.Format("alert('{0} {1}')", values["TextField1"], values["TextField2"]);
    
        return r;
    }

Similar Threads

  1. Replies: 1
    Last Post: Apr 09, 2012, 1:07 PM
  2. [CLOSED] ListFilter values
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 23, 2012, 3:41 PM
  3. [CLOSED] [1.0] MultiCombo set values
    By Patrick in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jul 06, 2011, 10:09 AM
  4. [CLOSED] [1.0] Multicombo and values
    By FVNoel in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Mar 25, 2011, 5:48 PM
  5. [CLOSED] Combo get values
    By CMA in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 04, 2009, 6:59 AM

Tags for this Thread

Posting Permissions