var object= {
url:url, //form提交数据的地址
type:type, //form提交的方式(method:post/get)
target:target, //服务器返回的响应数据显示的元素(Id)号
beforeSerialize:function(){} //序列化提交数据之前的回调函数
beforeSubmit:function(){}, //提交前执行的回调函数
success:function(){}, //提交成功后执行的回调函数
error:function(){}, //提交失败执行的函数
dataType:null, //服务器返回数据类型
clearForm:true, //提交成功后是否清空表单中的字段值
restForm:true, //提交成功后是否重置表单中的字段值,即恢复到页面加载时的状态
timeout:6000 //设置请求时间,超过该时间后,自动退出请求,单位(毫秒)。
}
<!DOCTYPE html>
<html>
<head>
<title>权限信息展示
</title>
<link href="~/Content/JqueryEasyUi/themes/default/easyui.css" rel="external nofollow" rel="stylesheet" />
<link href="~/Content/JqueryEasyUi/themes/icon.css" rel="external nofollow" rel="stylesheet" />
<script src="~/Content/JqueryEasyUi/jquery-1.8.3.min.js"></script>
<script src="~/Scripts/myjqueryform.js"></script>//这里引入
<script src="~/Content/JqueryEasyUi/jquery.easyui.min.js"></script>
<script src="~/Content/JqueryEasyUi/locale/easyui-lang-zh_CN.js"></script>
<script src="~/Scripts/datapattern.js"></script>
<script src="~/Scripts/jquery.unobtrusive-ajax.js"></script>
<script type="text/javascript">
$(function () {
//绑定异步上传图片
bindUpLoad();
});
//绑定异步上传图片
function bindUpLoad() {
alert("aaaaa");
$("#btnUpLoadFile").click(function () {
alert("bbbbb");
$("#AddDiglogDiv form").ajaxSubmit({
url: '/ActionInfo/UploadImg',
type: "Post",
success: function (data) {
alert("ccccc");
//将返回的数据加载到隐藏域
$("#IconImg").val(data);
$("#ShowImgDiv").html("<img src='" + data + "' style='width:100px; height:80px'/>");
}
});
});
}
<body>
<!-------------添加对话框 start--------------------->
<div id="AddDiglogDiv">
@using (Ajax.BeginForm("AddActionInfo", "ActionInfo", new AjaxOptions() { OnSuccess = "afterAdd" }))
{
<table>
<tr>
<td>权 限 名:</td>
<td>
<input type="text" name="ActionName" /></td>
</tr>
<tr>
<td>Url:</td>
<td>
<input type="text" name="Url" /></td>
</tr>
<tr>
<td>Http方法类型:</td>
<td>
<select name="HttpMethod">
<option value="GET">GET</option>
<option value="POST">POST</option>
</select>
</td>
</tr>
<tr>
<td>是否是菜单:</td>
<td>
<input type="checkbox" id="ckbIsMenuShow" value="true" name="IsMenu" /></td>
</tr>
<tr id="trMenuAdress">
<td>菜单图片地址:</td>
<td>
<input type="hidden" id="IconImg" name="IconImg" />
<input type="file" id="fileMenuIcon" name="fileMenuIcon" />
<input type="button" value="上传" id="btnUpLoadFile" />
<div id="ShowImgDiv"></div>
</td>
</tr>
<tr>
<td>排 序:</td>
<td>
<input type="text" name="Sort" /></td>
</tr>
<tr>
<td>备 注:</td>
<td>
<input type="text" name="Remark" /></td>
</tr>
</table>
}
</div>
<!-------------添加对话框 end --------------------->
</body>
</html>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有