Asp.net mvc 引导模式数据解除按钮正在发布表单
我在bootsrap模式中有一个表单。当我单击submit时,它发布数据并隐藏模式。伟大的但是,如果单击具有“数据解除”属性的“取消”按钮,它也会提交表单。我尝试了explicit type=button,但它仍然提交表单。我想取消按钮只是关闭模式,而不是做回发。有什么建议吗Asp.net mvc 引导模式数据解除按钮正在发布表单,asp.net-mvc,vb.net,razor,bootstrap-modal,Asp.net Mvc,Vb.net,Razor,Bootstrap Modal,我在bootsrap模式中有一个表单。当我单击submit时,它发布数据并隐藏模式。伟大的但是,如果单击具有“数据解除”属性的“取消”按钮,它也会提交表单。我尝试了explicit type=button,但它仍然提交表单。我想取消按钮只是关闭模式,而不是做回发。有什么建议吗 <div Class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" ar
<div Class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div Class="modal-dialog" role="document">
<div Class="modal-content">
<div Class="modal-header">
<h4 Class="modal-title">Change User</h4>
</div>
<div Class="modal-body">
@If Model.impersonate.isAllowed Or Model.isAdmin Then
@<form action='@Url.Action("Parent")' id="frmChangeUser" method="post">
@If Model.isAdmin Then
@<Label Class="lbl">Enter RACF Or EIN</Label>
@Html.EditorFor(Function(m) Model.userRacf, New With {.class = "form-control"})
Else
@<Label Class="lbl">Select an Operator</Label>
@<select id="select" class="form-control" onchange="$("#userRacf").val($(this).val());">
@For Each item In Model.impersonate.AccessList
@<option value="@item.Value.ToString">@item.Text.ToString</option>
Next
</select>
@<input type="text" id="userRacf" name="userRacf"/>
End If
<div Class="modal-footer">
<Button Class="btn-green" type="submit" id="getUser">Get</button>
<Button Class="btn-grey" type="button" data-dismiss>Cancel</button>
</div>
</form>
Else
@<label>You are not currently registered for impersonation, to request access fill out form on homepage</label>
@<Button Class="btn-grey" data-dissmiss="modal">OK</button>
End If
</div>
</div>
</div>
</div>
缺少模式页脚按钮模式应为-
<Button Class="btn-grey" type="button" data-dismiss="modal">Cancel</button>