C# 部分视图提交按钮不工作
我的问题是,提交按钮不起作用。如您所见,我的局部视图包含jquery模式。如果单击“mdlist”,模式将显示,并显示submit按钮 你能告诉我可能的问题是什么吗C# 部分视图提交按钮不工作,c#,asp.net-mvc,model,asp.net-mvc-partialview,C#,Asp.net Mvc,Model,Asp.net Mvc Partialview,我的问题是,提交按钮不起作用。如您所见,我的局部视图包含jquery模式。如果单击“mdlist”,模式将显示,并显示submit按钮 你能告诉我可能的问题是什么吗 @model IEnumerable<MyApp.Models.Participant> <link type="text/css" rel="stylesheet" href="http://code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css">
@model IEnumerable<MyApp.Models.Participant>
<link type="text/css" rel="stylesheet" href="http://code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.11.3/jquery-ui.js"></script>
<a id="mdlist" class="button" href="#"><span class="new icon"></span>Add Participant</a>
<div id="dialog" class="content-wrapper">
<div class="buttons">
<input type="submit" name="submitButton" value="Save" class="button save icon" />
</div>
<table cellspacing="0">
<thead>
<tr>
<th>
</th>
<th>
@Html.DisplayNameFor(model => model.Name)
</th>
</tr>
</thead>
@foreach (var item in Model)
{
<tbody>
<tr>
<td>
<input type="checkbox" name="ParticipantCheck" id="@item.ID" />
</td>
<td>
@Html.DisplayFor(modelItem => item.Name)
</td>
</tr>
</tbody>
}
</table>
</div>
<script type="text/javascript">
$(function () {
$("#dialog").dialog({
autoOpen: false,
height: 400,
width: 670,
modal: true,
closeOnEscape: true,
resizeable: false
});
</script>
@model IEnumerable
@DisplayNameFor(model=>model.Name)
@foreach(模型中的var项目)
{
@DisplayFor(modelItem=>item.Name)
}
$(函数(){
$(“#对话框”)。对话框({
自动打开:错误,
身高:400,
宽度:670,
莫代尔:是的,
closeOnEscape:没错,
可调整大小:false
});
首先,您需要通过以下方式添加表单
(提交按钮仅在有表单时有效)
接下来,如果您有一个数组,您添加复选框的方式不正确,请查看链接
@using(@Html.BeginForm()){
//place your html elements and submit button here
}