ASP:按钮的更新进度
update progress for ASP:Button
我想在单击服务器端按钮时使用显示"正在加载图像",该图像应在按钮事件完成后卸载。
http://ajax.net-tutorials.com/controls/updateprogress-control/必须在这里使用Javascript。
$('#btnChange').click(function (event) {
if (event.preventDefault) event.preventDefault();
else event.returnValue = false;
var dto = { 'id': value };
//Webservice call started
$.ajax({
type: "POST",
url: ".......",
data: JSON.stringify(dto),//you need json2.min.js for JSON.stringify() method
contentType: "application/json; charset=utf-8",
dataType: "json",
beforeSend: function () {
$('#imageid').attr('src', '../images/load.gif');
//Show Loading Image which will show the progress
},
success: function (msg) {
//When Successfully completed
},
error: function (xhr, status) {
//when error occurs
}
});
});
您可以使用
ASP.NET Ajax UpdateProgress
控件:
<asp:UpdatePanel ID="UdpFormPanel" runat="server >
<ContentTemplate>
<asp:UpdateProgress ID="UpdateProgress1" DynamicLayout="true" runat="server"
AssociatedUpdatePanelID="UdpFormPanel" DisplayAfter="0" >
<ProgressTemplate>
<div class="progress">
<asp:Image ID="ImgProgress" runat="server"
ImageUrl="~/images/ajax-loader-arrows.gif"
ToolTip="loading..." /> please wait...
</div>
</ProgressTemplate>
</asp:UpdateProgress>
..............
这是一个考试进度类:
.progress
{
text-align:center;
vertical-align:middle;
position: absolute;
left: 44%;
top: 40%;
border-style:outset;
border-color:silver;
background-color:Silver;
white-space:nowrap;
padding:5px;
}
相关文章:
- 选择单选按钮时显示更新按钮
- 如何更新按钮内部的文本,每行重复一次
- 如何在jQuery的.on()方法中动态更新按钮的ID选择器
- 当我点击更新按钮时,它赢得了't更改/更新(CodeIgniter,更新多行)
- 单击“更新”按钮后,请求不以“放置”形式进行,而是以“POST”形式发送
- 带有更新按钮.js D3 将新数据添加到旧数据而不是替换旧数据
- 如何在 Meteor 中使用多个输入字段和单个更新按钮更新文档
- 更新按钮文本和其他问题
- JavaScript OnClient点击破坏RadGrid插入/更新按钮在web表单上提交行为
- 表单提交/更新按钮
- 使用ajax和data-*属性更新按钮
- jQuery -数据库访问失败后的更新按钮图标
- 使用JavaScript更新按钮上的文本
- 通过inputfield更新按钮文本
- ExtJS -更新按钮时,编辑一行调用函数
- 更新按钮id
- Ajax:将复选框功能转换为Wordpress中的输入字段和更新按钮
- Jquery克隆和更新按钮图标
- 为所有值创建一个更新按钮
- 一个基于抽动流状态更新按钮颜色的函数