[CLOSED] Get value from textfield in controller [Razor]

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] Get value from textfield in controller [Razor]

    When using direct click on button i can get value form one textfield in controller, but when use direct click in button on window value of textbox is null.

    This is a textfield:

    @Html.X().TextField().ID("tfID").FieldLabel("Labela 23").Text("Some text ...")
    This example works:

    @(Html.X().Button()
            .ID("btnID2")
            .Text("Direct event 2")
            .DirectEvents(directEvents => 
            {
                directEvents.Click.Url = "/Account/TestMethod";
            })
        )
    and controller:

    public ActionResult TestMethod(string tfID) 
            {
                AjaxResult r = new AjaxResult();
                r.Script = X.Msg.Alert("", "Vrednost: " + tfID).ToScript();
                return r;
            }

    But in this example where I only use Window it is not work:

    @(Html.X().Window().ID("WindowLogIn")
            .Layout(LayoutType.Anchor)
            .Width(300)
            .Height(150)
            .Title("Test")
                .Items(item =>
                {
                    item.Add(Html.X().Button().ID("ButtonPrijava").Text("Prijavi me").DirectEvents(directEvents => { directEvents.Click.Url = "/Account/TestMethod"; })); 
                })
    
        )

    For both examples I put razor code in BeginForm

    @using (Html.BeginForm())
    {
    }
    Can you help me to handle this data from textbox in controller.
    Last edited by Daniil; Apr 16, 2012 at 11:53 AM. Reason: [CLOSED]

Similar Threads

  1. [CLOSED] [RAZOR] How to access ext.net controls from controller method
    By gets_gui in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Sep 13, 2012, 8:12 AM
  2. [CLOSED] [Razor] TreePanel load nodes from controller action
    By boris in forum 2.x Legacy Premium Help
    Replies: 8
    Last Post: May 18, 2012, 9:43 AM
  3. [Razor] Populating form values from controller
    By machinableed in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: May 07, 2012, 10:42 AM
  4. Replies: 6
    Last Post: Apr 09, 2012, 3:33 PM
  5. [CLOSED] How to access/reload store in razor views/controller
    By machinableed in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Apr 02, 2012, 1:38 PM

Tags for this Thread

Posting Permissions