asp.net – 如何在回发触发器中添加进度条
发布时间:2020-12-16 03:57:58 所属栏目:asp.Net 来源:网络整理
导读:我在我的项目中使用更新面板.我在面板内使用两个按钮控件.我已经为该按钮提供了回发触发器,但进度条不适用于该按钮控件.因为回发触发器.如果我删除回发触发器它工作正常.但我想将回发触发器添加到我的按钮.任何人都可以帮我解决这个问题. 提前致谢 解决方法
我在我的项目中使用更新面板.我在面板内使用两个按钮控件.我已经为该按钮提供了回发触发器,但进度条不适用于该按钮控件.因为回发触发器.如果我删除回发触发器它工作正常.但我想将回发触发器添加到我的按钮.任何人都可以帮我解决这个问题.
提前致谢 解决方法
我发现了这个,它对我有用.你可以根据自己的需要改变它
它适用于每个页面回发,如果您想限制然后更改代码以满足您的要求. <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> .modalPopup { background-color: #696969; filter: alpha(opacity=40); opacity: 0.7; xindex:-1; } </style> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"/> <script type="text/javascript"> var prm = Sys.WebForms.PageRequestManager.getInstance(); //Raised before processing of an asynchronous postback starts and the postback request is sent to the server. prm.add_beginRequest(BeginRequestHandler); // Raised after an asynchronous postback is finished and control has been returned to the browser. prm.add_endRequest(EndRequestHandler); function BeginRequestHandler(sender,args) { //Shows the modal popup - the update progress var popup = $find('<%= modalPopup.ClientID %>'); if (popup != null) { popup.show(); } } function EndRequestHandler(sender,args) { //Hide the modal popup - the update progress var popup = $find('<%= modalPopup.ClientID %>'); if (popup != null) { popup.hide(); } } </script> <div> <asp:UpdateProgress ID="UpdateProgress" runat="server"> <ProgressTemplate> <asp:Image ID="Image1" ImageUrl="loader.gif" AlternateText="Processing" runat="server" /> </ProgressTemplate> </asp:UpdateProgress> <ajaxToolkit:ModalPopupExtender ID="modalPopup" runat="server" TargetControlID="UpdateProgress" PopupControlID="UpdateProgress" BackgroundCssClass="modalPopup" /> <asp:UpdatePanel ID="pnlData" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:Button ID="btnSubmit" runat="server" Text="Submit" onclick="btnSubmit_Click"/> </ContentTemplate> </asp:UpdatePanel> </div> </form> </body> </html> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net-mvc-2 – MVC Html.TextBoxFor MaxLength和Value
- 一步一步创建ASP.NET MVC5程序[Repository+Autofac+Automap
- asp.net-mvc-4 – 将ninject dependecyResolver用于MVC和We
- asp.net-web-api2 – asp.net 5和IdentityServer4
- asp.net-mvc – 域vs DTO vs ViewModel – 如何和何时使用它
- asp.net-mvc – IIS7 ASP.NET MVC客户端缓存标头不起作用
- asp.net – ADFS 2.0超时以及Freshness Value,TokenLifetim
- asp.net – 有什么功能,将帮助我重构CSS
- ASP经典字符串变量最大大小?
- .net core 中的经典设计模式的应用
推荐文章
站长推荐
热点阅读