Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
806 views
in Technique[技术] by (71.8m points)

razor - Devextreme submit form to controller

I have a custom popUp that contains : a form and a grid inside of a tabPanel, i want to validate the form first, stay in the same popup then enable the grid and work with it enter image description here

//RazorPage
 @using (Html.BeginForm("PostWithForm", "OrdresTravailMecanique", FormMethod.Post))
    {
        @(Html.DevExtreme().Form<EditerOrdreTravailModel>()
        .Items(items =>
        {
            ....
            //the validation button for the form
            items.AddButton()
            .HorizontalAlignment(HorizontalAlignment.Right)
            .ButtonOptions(b => b.Text("Enregistrer")
                .Type(ButtonType.Success)
                .UseSubmitBehavior(true)
                .OnClick("showTravauxTab")
            );
        })
        )
        @(Html.DevExtreme().TabPanel()
        .ID("TravauxTab")
        .Disabled(true)
        .Items(items =>
        {
            //DataGridTemplate
            items.Add()
                .Title("Travaux")
                .Template(new TemplateName("TachesOtAddGrid"));
        })
        )

    }
//Controller
[HttpPost]
public async Task<IActionResult> PostWithForm(EditerOrdreTravailModel values)
{...}

Problem is : The submitBehaviourButton sends me to a diffrent view, so i can't work with the grid after submiting the form

question from:https://stackoverflow.com/questions/65882347/devextreme-submit-form-to-controller

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...