Default form submit not working

1 Answer 122 Views
Form
Rikki
Top achievements
Rank 1
Rikki asked on 07 Sep 2022, 03:54 AM

Hi ,I am basically new to Telerik. I am trying to use a layout form in my view. but it is not posting data to the database. I did debugged all of my controllers and models so they are working fine, something is wrong in the view itself and I can't figure out what. Please help!!!!!!!!

This is all of my view (Create): 

@model WeighmoreSouth32Web.Models.Site
@using Kendo.Mvc.UI
@{
    ViewData["Title"] = "Create";
}

<h1>Create a Site</h1>


<div class="demo-section">

    <div id="validation-success"></div>
    
    @(Html.Kendo().Form<WeighmoreSouth32Web.Models.Site>()
        .Name("exampleForm")
        .HtmlAttributes(new { action = ("Create"), method="POST"})
        .Items(itemss =>
        {
            itemss.AddGroup().Layout("grid").Grid(g => g.Cols(3).Gutter(20)).Label("Personal Info").Items(items => { 
                   items.Add()
                        .Field(f => f.Name)
                        .Label(l => l.Text("Name:"));
                    items.Add()
                        .Field(f => f.Code)
                        .Label(l => l.Text("Code:"));
                    items.Add()
                        .Field(f => f.ABN)
                        .Label(l => l.Text("ABN:"))
                        .Hint("Hint: enter numeric/space characters only."); 
                        items.Add().ColSpan(3).Field(f => f.Description)
                        .Label(l => l.Text("Description:"))
                        .Editor(e => e.TextArea().Rows(2));
                        });
            })

    )
    
</div>

<div>
    <a asp-action="Index">Back to List</a>
</div>

    @section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}


1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 09 Sep 2022, 04:32 PM

Hello Rikki,

 

Thank you for writing to us.

When you open the page on Chrome browser and enable the F12 inspector console, do you see any script errors interfering? And any broken links in the Network tab of the inspector?

Can you modify the following live sample to demonstrate the mentioned issue and send it back to us for further investigation?
https://netcorerepl.telerik.com/wmaNEXvU30r6p9QX28

Alternatively, you can open a formal support ticket and send us a very basic MVC sample with the issue. We will then fix all the problems you are facing and send the updated working project back to you.

 

Regards,
Eyup
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Rikki
Top achievements
Rank 1
commented on 12 Sep 2022, 02:54 AM | edited

Hi, 

Thank you for the comment, I was able to fix it, the error occured because of Anti-forgery token.
Anton Mironov
Telerik team
commented on 14 Sep 2022, 10:25 AM

Hi Rikki,

Thank you for sharing it with the community.

If any further assistance or information is needed, do not hesitate to contact the Team.


Kind Regards,
Anton Mironov

Tags
Form
Asked by
Rikki
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or