Jquery ASP.NET C#加载页面时显示加载图像
选择RadioButtonList和DropdOnlist时,是否有加载图像的建议??或者可以在页面加载时放置一些消息,如“请稍候..页面正在加载”。正在加载自动回发的图像。我有一个主页 这是网络表单Jquery ASP.NET C#加载页面时显示加载图像,jquery,asp.net,loading-image,Jquery,Asp.net,Loading Image,选择RadioButtonList和DropdOnlist时,是否有加载图像的建议??或者可以在页面加载时放置一些消息,如“请稍候..页面正在加载”。正在加载自动回发的图像。我有一个主页 这是网络表单 <td class="auto-style177"> <asp:Panel ID="Panel101" runat="server" Visible="False"> <asp:RadioButtonList ID="rbPembeli2" runat="server
<td class="auto-style177">
<asp:Panel ID="Panel101" runat="server" Visible="False">
<asp:RadioButtonList ID="rbPembeli2" runat="server" CellPadding="0" CellSpacing="0"
Font-Size="X-Small" Height="20px" RepeatDirection="Horizontal" Width="277px"
AutoPostBack="True" OnSelectedIndexChanged="rbPembeli2_SelectedIndexChanged">
<asp:ListItem Value="9">HQ ANA EDAR</asp:ListItem>
<asp:ListItem Text="PDA/PPN" Value="0"></asp:ListItem>
<asp:ListItem Text="PPP/PPW" Value="5"></asp:ListItem>
</asp:RadioButtonList></asp:Panel>
</td>
阿纳伊达总部
这是Js
function ShowProgress() {
setTimeout(function () {
var modal = $('<div />');
modal.addClass("modal");
$('body').append(modal);
var loading = $(".loading");
loading.show();
var top = Math.max($(window).height() / 2 - loading[0].offsetHeight / 2, 0);
var left = Math.max($(window).width() / 2 - loading[0].offsetWidth / 2, 0);
loading.css({ top: top, left: left });
}, 200);
}
$('form').live("submit", function () {
ShowProgress();
});
函数ShowProgress(){
setTimeout(函数(){
var模态=$('');
modal.addClass(“modal”);
$('body')。附加(模态);
变量加载=$(“.loading”);
loading.show();
var top=Math.max($(window.height()/2-load[0].offsetHeight/2,0);
var left=Math.max($(窗口).width()/2-正在加载[0].offsetWidth/2,0);
正在加载.css({top:top,left:left});
}, 200);
}
$('form').live(“提交”),函数(){
ShowProgress();
});
更改如下:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Panel ID="Panel101" runat="server" Visible="False">
<asp:RadioButtonList ID="rbPembeli2" runat="server" CellPadding="0" CellSpacing="0"
Font-Size="X-Small" Height="20px" RepeatDirection="Horizontal" Width="277px"
AutoPostBack="True" OnSelectedIndexChanged="rbPembeli2_SelectedIndexChanged">
<asp:ListItem Value="9">HQ ANA EDAR</asp:ListItem>
<asp:ListItem Text="PDA/PPN" Value="0"></asp:ListItem>
<asp:ListItem Text="PPP/PPW" Value="5"></asp:ListItem>
</asp:RadioButtonList></asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<div id="Background">
</div>
<div id="Progress">
<img src="images/loading.gif" alt="" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
不要使用任何JS。查看pace提供的进度条,您不必为任何图像加载编写代码,只需包含必要的文件(JS和css)…谢谢:)@PrakashTheteAre您使用web表单吗?使用更新面板?web表单,但不使用更新面板@Piyushkhart你能在这里发布你的网页表单代码吗?它不起作用。我的主页上有js用于其他功能。你可以保持js的原样,但使用我发送给你的内容。就像我测试的那样
#Background
{
position: fixed;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
background-color: Gray;
filter: alpha(opacity=40);
opacity: 0.4;
z-index: 1006;
}
#Progress
{
position: fixed;
top: 30%;
left: 48%;
z-index: 1006;
}