mvc返回语句 Content(" alert(‘修改失败’);", “text/javascript”);
ActionResult 数据返回
public ActionResult UpdatePassword(string pwd)
{
Administrators user = Session[“session_admin_info”] as Administrators;
if (DALUser.ChangePassword(user.id, pwd)==“ok”)
{
Session.Remove(“session_admin_info”);
Session.Remove(“session_admin_info”);
Utils.Utils.romecookie(“UserName”);
Utils.Utils.romecookie(“pwd”);
return Content(“alert(‘修改成功,请重新登录!’); window.parent.location.reload(); “, “text/javascript”);
}
else
{
return Content(” alert(‘修改失败’);”, “text/javascript”);
}
}
使用 mvc的dom
@Html.DropDownList(“TK_minid”, new SelectList(ViewBag.que, “Value”, “Text”), new { @class = “form-control”, @data_ive_search = “true” })
标签后倒入
导入
使用Html.BeginForm
@using (Html.BeginForm(“Import”, “TK”, FormMethod.Post, new { enctype = “multipart/form-data”, @class = “form-horizontal”, @id = “updateform” }))
{
@Html.DropDownList(“TK_minid”, new SelectList(ViewBag.que, “Value”, “Text”), new { @class = “form-control”, @data_ive_search = “true” })
请选择
单项选择题
判断题
</div>
</div>
<div class="modal-body">
<div class="form-group">
<label class="col-sm-2 control-label " name="Option_Nmae">文件</label>
<div class="col-sm-7">
<input type="file" id="Excel" name="Excel" />
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary waves-effect waves-light" id="upsub" onclick="add()">保存</button>
</div>
}