- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试将 UpdateProgress 与触发器一起使用(请参阅下面的代码)但是当单击分配为 asyncPostBackTrigger 的按钮时,UpdateProgress 不起作用。如果我删除 AssociatedUpdatePanelID 属性,UpdateProgress 控件将起作用。但是我想配置独立的 UpdateProgress 所以,我需要指定UpdateProgress 控件的 AssociatedUpdatePanelID 属性。
这是应该的行为吗?
NOTE: I do not want to intercept the Sys.WebForms.PageRequestManager instance and manipulate the asyncronous request to manually display and hide the UpdateProgress element. Is there a way to do that?
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="AjaxExtensionsTest._Default" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<asp:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server">
</asp:ScriptManager>
<h2>
Ajax Extensions Test
</h2>
<asp:UpdatePanel ID="up1" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<div id="content">
<asp:TextBox ID="txtDataHora" runat="server"></asp:TextBox>
<asp:UpdateProgress ID="progress1" AssociatedUpdatePanelID="up1" DynamicLayout="true" DisplayAfter="0" runat="server">
<ProgressTemplate>
<div>
<img alt="progress" src="loading.gif" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnSubmit" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
<asp:Button ID="btnSubmit" Text="Get Current Date/Time" runat="server" onclick="btnSubmit_Click" />
<p>
</p>
</asp:Content>
<script runat="server" language="csharp">
protected void Page_Load(object sender, EventArgs e)
{
ScriptManager1.RegisterAsyncPostBackControl(btnSubmit);
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
txtDataHora.Text = DateTime.Now.ToString("dd/MM/yyyy hh:mm:ss");
System.Threading.Thread.Sleep(2000);
}
</script>
最佳答案
如果您需要使用 AsyncPostBackTrigger 和 AssociatedUpdatePanelID,那么您唯一的选择是处理 Sys.WebForms.PageRequestManager 实例上的事件并手动显示和隐藏 UpdateProgress 元素。那里有代码在服务器上运行并注入(inject)必要的 JavaScript,这些 JavaScript 可以封装到控件中,从而使这一切变得非常整洁。
关于c# - 带触发器的 UpdateProgress 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10162138/
我有一个 UpdateProgress 控件,它显示为更新面板的所有异步事件的覆盖层(使用 CSS)。现在,对于某些 EXPAND/COLLAPSE 行命令事件,我只是不想显示更新进度。 有办法吗?
我已经检查了这个解决方案:Is there a way to disable UpdateProgress for certain async postbacks? 但这会完全禁止我的控件加载! 我的
我试图在加载网格时在我的 GridView 顶部显示一个 div。 这是我放置 UpdateProgress、UpdatePanel 和 GridView 的方式:
我正在尝试使用更新面板内的 asp.net 文件上传控件上传图像文件。我想处理 UpdateProgress 以显示指示进度的进度条图像以及文件上传。 案例 1: 当我删除触发器部分并使用 Updat
我正在尝试禁用页面元素并在我的应用程序中显示更新进度控件。为了让它工作,我应用了带有属性的样式表 过滤器:alpha(不透明度=85); 但它显示错误“filter is not a known CS
我正在尝试将 UpdateProgress 与触发器一起使用(请参阅下面的代码)但是当单击分配为 asyncPostBackTrigger 的按钮时,UpdateProgress 不起作用。如果我删除
我有一个带有 ListView 的 ASP.NET 应用程序。我从 Active Directory 获取数据,现在如果 ListVew 正在构建,我需要一个等待符号。我想我会使用 Ajax 控件工具
我的 ASP.NET 页面上有一个按钮,它从我的数据库中获取一些数据并将其显示在 GridView 上。 这个过程需要一段时间,所以我想我会添加一个 updateprogress AJAX 控件。现在
我正在使用 Ajax UpdateProgress 控件。虽然它按我预期的那样工作,但我希望它出现在页面的中心。我怎么做
我的 UpdateProgress 在 UpdatePanel 之外,我已经尝试了以下方法 添加了 JavaScript,在母版页中添加了“AsyncPostBackTimeout=3600” 在 P
当您设置或更新 progressView 的 float 时,它会自动更新 progressView 吗? 比如调用一个方法: - (void) updateProgress:(float)progr
我正在创建一个 ASPP.Net 网页。因为它必须加载大量的日期,最多可能需要 60 秒,所以我想通知用户这可能需要一段时间。我想将整个屏幕调暗一点并写上“正在加载,请稍等”。为此,我在 中创建了一
我有一个订单输入页面可能需要一些时间来处理,用户认为浏览器已卡住并关闭它。这是一个弹出式浏览器,当单击 cmdAdd 按钮时,文本框中的项目被写入数据库,子窗口关闭,父窗口刷新以查看更改。这目前工作正
我在 Asp.net 中使用更新面板。我有更新进度,为此我设置了一个 DIV 并为其设置了一个 CSS。问题是当我调用它时,它会显示进度条,但我可以滚动窗口。我需要将其设置为模式(显示进度条时无法选择
这只是一个测试页面,所以我可以看到工作指示器的样子,但是该死的 UpdateProgress 根本没有显示... 测试只是构建一个对象列表并填充列表框,而列表框中的项目少于 100 个。
每当我的更新面板执行 Ajax 操作时,我都会尝试显示更新进度加载图像。我环顾四周,看起来很简单,但我没有运气。这几乎是我所拥有的......
我有一个使用 ASP.NET 开发的网站。那里发生了很多 ajax 请求。所以我想在发生ajax请求时显示图像并在加载数据后隐藏图像。现在一切正常, 这是我到目前为止所做的
我在下面有这个简单的代码,它在 updateProgress 期间更新 TextArea: textArea = new TextArea(); textArea.setEditable(false)
问题:为什么我的 UpdateProgress 在初始页面加载期间不显示,但在通过按钮单击进行的后续回发中显示? 我成功实现此功能的唯一方法是使用计时器,但我并不热衷于计时器。还有别的办法吗? 有人可
我是一名优秀的程序员,十分优秀!