Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
803 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 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...