简体   繁体   English

kendo ui按钮http发布不触发

[英]kendo ui button http post not firing

In my index.cshtml page, following line of code DOES fire HttpPost so that I could get into the HttpPost tagged Index method in the controller class. 在我的index.cshtml页面中,下面的代码行触发了HttpPost,因此我可以进入控制器类中带有HttpPost标记的Index方法。

 <input type="submit" value="Run Calculation" />

            [HttpPost]
            public ActionResult Index(TimberBeamCalculator.Models.Dimensions dim)
            {
    ..................
            }

But the following code for kendo ui button, does not fire the HttpPost mentioned above. 但是以下针对kendo ui按钮的代码不会触发上面提到的HttpPost。

 @Html.Kendo().Button().Name("setting").Icon("pencil").HtmlAttributes(new { type = "button" }).Content("Run Calculation");

What am I missing?? 我想念什么?

Kendo.button does not render out as a submit button. Kendo.button不会呈现为提交按钮。 You either need to tweak the properties of your kendo button to make it a submit button, or use jquery to do something like 您需要调整kendo按钮的属性以使其成为“提交”按钮,或者使用jquery执行类似的操作

$("#setting").click(function()
{ 
  $("#idOfYourForm").submit();
});

First, you should try setting the HtmlProperties of your kendo button with type of submit. 首先,您应该尝试使用提交类型设置kendo按钮的HtmlProperties。 If that doesn't work, go for the jquery route I mentioned. 如果这不起作用,请使用我提到的jquery路由。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM