大家好我有这个代码:
function test()
{
req = new XMLHttpRequest();
req.upload.addEventListener("progress", updateProgress, false);
req.addEventListener("readystatechange", updateProgress, false);
req.addEventListener("error", uploadFailed, false);
req.addEventListener("abort", uploadCanceled, false);
var data = generateRandomData(currentPayloadId);
totalSize = data.length;
req.open("POST", "www.mydomain.com/upload.aspx");
start = (new Date()).getTime();
req.send(data);
}
function updateProgress(evt)
{
if (evt.lengthComputable) {
total = totalSize = evt.total;
loaded = evt.loaded;
}
else {
total = loaded = totalSize;
}
}
Run Code Online (Sandbox Code Playgroud)
此外,我的服务器响应了对于upload.aspx的初始OPTIONS请求200和Access-Control-Allow-Origin:*然后第二个请求POST发生
一切似乎都已到位,它在FireFox上运行良好,但在G Chrome上,updateProgress处理程序不会被调用但只调用一次,然后lengthComputable为false.
我需要Access-Control-Allow-Origin:*因为这是一个跨域调用,脚本父级是不同服务器上的资源,然后是upload.aspx域
任何人都可以给我一些线索,提示,请帮忙吗?这是G Chrome的一个已知问题吗?
谢谢!OVA
javascript security google-chrome xmlhttprequest updateprogress
我有一个UpdatePanel:
<asp:UpdatePanel runat="server" ID="panelFatt">
<ContentTemplate>
<div class="row" runat="server" id="divCFPIva">
<div class="col-md-6">
<div class="form-group">
<label for="txtCF">Codice Fiscale</label>
<asp:TextBox runat="server" ID="txtCF" type="text" MaxLength="16" class="form-control" />
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="txtPIVA">Partita IVA</label>
<asp:TextBox runat="server" ID="txtPIVA" type="text" MaxLength="11" class="form-control" />
</div>
</div>
<div class="col-md-12">
<span class="help-inline hidden lblerror" runat="server" id="lblErrorCFPIva"></span>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group" runat="server" id="divEmail">
<label for="txtEmail" class="control-label">Email*</label>
<div class="controls">
<asp:TextBox runat="server" TextMode="Email" type="text" ID="txtEmail" class="form-control" />
<span class="help-inline hidden lblerror" runat="server" id="lblErrorEmail"></span>
</div>
</div>
</div> …Run Code Online (Sandbox Code Playgroud) 看看这个标记:
<asp:UpdatePanel ID="Panel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="cboBox1" ClientIDMode="Static" AutoPostBack="true" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="cboBox2" runat="server" />
<asp:UpdateProgress ID="UpdateProgress1" style="display: inline" AssociatedUpdatePanelID="Panel1" DynamicLayout="false" DisplayAfter="0" runat="server">
<ProgressTemplate>
<img src='<%= ResolveClientUrl("~/Images/indicator.gif")%>' border="0" alt="" />
</ProgressTemplate>
</asp:UpdateProgress>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="cboBox1" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
Run Code Online (Sandbox Code Playgroud)
UpdateProgress控件最初工作,但是当我们将ClientMode ="Static"添加到cboBox1时,它就崩溃了.将其还原为AutoID不是一个选项,因此我需要找到允许UpdateProgress面板与ClientIDMode ="Static"一起使用的解决方案.
另外,有人可以在标签列表中添加"clientidmode"吗?
我有一个内容页面,其中包含更新面板和更新进度控件.页面回发时,将正确显示"更新进度"控件.我现在已经向页面添加了一个Modal Popup Extender.从Modal Popup Extender触发回发时,将显示Update Progress控件,但在Modal Popup Extender下面.
如何强制更新进度控件显示在顶部?
asp.net modalpopupextender ajaxcontroltoolkit updateprogress
我有以下UpdateProgress:
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="updCampos"
DynamicLayout="true">
<ProgressTemplate>
<div class="carregando">
<span id="sAguarde">Aguarde ...</span> <asp:Image ID="Image1" runat="server" ImageUrl="~/images/loading.gif" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
Run Code Online (Sandbox Code Playgroud)
我需要更改嵌入"sAguarde"范围内的文本"Aguarde ..."内容后面的代码,但我不知道如何访问此跨度.语言是C#.
非常感谢您的帮助.
我使用了ajax更新进度控件,显示回发发生时的动画gif.
问题:它会显示一段时间但会停止引用(或者更确切地说,停止播放/转动).可能是同样的原因是什么?
请指教!.谢谢!
我有一个ASP.NET应用程序ListView.我从Active Directory获取数据,现在我想要一个等待符号,如果它ListVew正在构建.我以为我使用了UpdateProgressAjax Control工具包中的Control.但是我不知道如果我点击按钮并且等待符号(例如gif)关闭,如果ListView完成,我将如何使用它.:(
我的CS档案:
protected void btnBenutzerSuchen_Click(object sender, EventArgs e)
{
//If I click on this Button the gif must start
try
{
... // my ListView get data
this.myListView.DataSource = dv;
this.myListView.DataBind();
...
}
catch (Exception)
{
...
}
//If the ListView is finish the gif must close
}
Run Code Online (Sandbox Code Playgroud)
我怎么能这样做 我可以这样做UpdateProgress:
<asp:UpdateProgress ID="UpdateProgress1" DynamicLayout="true" runat="server" AssociatedUpdatePanelID="?" >
<ProgressTemplate>
<div class="progress">
<img src="images/ajax-loader-arrows.gif" /> please wait...
</div>
</ProgressTemplate>
</asp:UpdateProgress> …Run Code Online (Sandbox Code Playgroud) <asp:UpdatePanel ID="Upnl1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table width="100%"><tr>
<td align="center" colspan="3">
<asp:Button ID="btnShowReport" runat="server" CssClass="ButtonClassLong" SkinID="LargeButton"
Text="Show Report" OnClick="btnShowReport_Click" TabIndex="15" />
<asp:Button ID="btnClear" runat="server" CssClass="ButtonClass" Text="Clear" OnClick="btn_Click"
TabIndex="16" />
<asp:Button ID="btnClose" runat="server" CssClass="ButtonClass" OnClick="btnClose_Click"
Text="Close" CausesValidation="False" TabIndex="17" />
<asp:CheckBox ID="ChkPrint" Text="Print View" runat="server" TabIndex="14" />
</td>
</tr>
</table></ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="btnShowReport" />
</Triggers></asp:UpdatePanel><asp:UpdateProgress ID="UpdateProgress" runat="server">
<ProgressTemplate>
<asp:Image ID="Image1" ImageUrl="~/App_Themes/RIBO/Images/Progress.gif" AlternateText="Processing"
runat="server" />
</ProgressTemplate>
</asp:UpdateProgress>
Run Code Online (Sandbox Code Playgroud)
这是我的编码,我的问题是当我点击清除按钮时更新进度运行良好,当我点击btnShowReport它不会工作.
如何显示触发器属性内的按钮单击事件的更新进度.
我正在使用Ajax updateprogress而且我附加了一个加载gif,问题是我怎么能强迫loading.gif在屏幕的中心,即使你在页面的最底部/顶部?有没有办法让它始终出现在中心?我希望用户在中心看到加载gif始终为他们通知页面仍在加载..
.CenterPB
{
position: absolute;
left: 50%;
top: 50%;
margin-top: -20px; /* make this half your image/element height */
margin-left: -20px; /* make this half your image/element width */
width:auto;
height:auto;
}
<asp:UpdateProgress ID="UpdateProgress1" runat="server" DynamicLayout="false">
<ProgressTemplate>
<div class="CenterPB" style="height: 40px; width: 40px;">
<asp:Image ID="Image1" runat="server" ImageUrl="~/App_Themes/Default/images/progressbar1.gif"
Height="35px" Width="35px" />
Loading ...
</div>
</ProgressTemplate>
</asp:UpdateProgress>
Run Code Online (Sandbox Code Playgroud)
谢谢!
UpdateProgress当用户点击"下一步"按钮转到下一页时,我想在页面A上显示.下一页是页面B,其中包含大量数据.
单击该按钮时,它不会显示UpdateProgress.
此代码中缺少什么,以及如何显示?
<asp:UpdateProgress ID="UpdateProgress1" runat="Server" AssociatedUpdatePanelID="UpdatePanel1">
<ProgressTemplate >
Please wait ...
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnNext" EventName="Click" />
</Triggers>
<ContentTemplate>
<asp:Button ID="btnCancel" runat="server" TabIndex="1" Text="Cancel"onclick="btnCancel_Click" />
<asp:Button ID="btnNext" runat="server" TabIndex="2" Text="Next" onclick="btnNext_Click" />
</ContentTemplate>
</asp:UpdatePanel>
Run Code Online (Sandbox Code Playgroud) 需要在放置在Ajax更新面板中的网格视图的中心显示更新进度.有没有办法使用CSS(不使用jQuery或Java Script)将Update progreass控件放在网格视图(或页面中心)的中心?
我正在使用使用 C# 的 ASP .NET 4.0。我有一个 Web 表单,其中所有布局都存在于 UpdatePanel 中。在里面我有以下内容:
用于使用文本框和搜索按钮输入搜索条件的面板
使用动画 .gif 更新进度
带有根据我的第一个存储过程(使用搜索条件)填充的中继器的面板 - 每行内部都有一个 LinkButton,单击该按钮时会调用我的第二个存储过程并在中继器行中填充面板。我正在中继器的 ItemCommand 事件的代码隐藏中填充面板。我将 LinkButton 上的 CommandArgument 用于第二个存储过程。我有一个 CollapsiblePanelExtender 来对包含第二个存储过程中的数据的面板进行动画处理。
我可以正常工作,但不是我想要的方式。单击搜索按钮时,UpdateProgress 会显示我的动画 .gif。但是,当在 Repeater 数据行中单击 LinkButton 时,我的第二个存储过程需要大约 6 秒的时间来处理。我想要一个 UpdateProgress 在发生这种情况时显示动画 .gif。我尝试通过实施第二个 UpdatePanel 来解决此问题,但我根本无法触发 UpdateProgress。任何帮助将不胜感激。提前致谢。
updateprogress不会显示gif.如果下拉列表位于updatepanel内,没有触发器,则可以正常工作.任何的想法?
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true" onselectedindexchanged="DropDownList1_SelectedIndexChanged">
</asp:DropDownList>
<asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="UpdatePanel1" runat="server" DisplayAfter="0">
<ProgressTemplate>
<div id="IMGDIV" align="center" valign="middle" runat="server" style="position: absolute;left: 52%;top: 61%;visibility:visible;vertical-align:middle; background-color:Transparent">
<img src="../App_Themes/Default/images/27-1.gif" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<cc1:Chartlet ID="Chartlet1" runat="server" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="DropDownList1" EventName="selectedindexchanged" />
</Triggers>
</asp:UpdatePanel>
Run Code Online (Sandbox Code Playgroud) updateprogress ×13
asp.net ×10
updatepanel ×6
ajax ×3
c# ×3
asp.net-ajax ×2
css ×2
javascript ×2
html ×1
linkbutton ×1
listview ×1
panel ×1
repeater ×1
security ×1
static ×1
time-wait ×1
webforms ×1