Trigger で指定したイベントの場合 UpdateProgress が表示されない?
<<
作成日時 : 2007/10/22 18:28
>>
トラックバック 1 / コメント 0
こんな画面があります。
ASPX はこうなっています。
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True">
<asp:ListItem Value="2">大文字</asp:ListItem>
<asp:ListItem Value="1">小文字</asp:ListItem>
</asp:DropDownList>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:GridView ID="GridView2" runat="server">
</asp:GridView>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="DropDownList1"
EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1"
runat="server"
AssociatedUpdatePanelID="UpdatePanel1"
DisplayAfter="10">
<ProgressTemplate>
<span style="vertical-align:middle"><img src="aero_light.gif" />更新中</span>
</ProgressTemplate>
</asp:UpdateProgress>
ドロップダウンリストで値が変更された場合に UpdatePanel に配置された GridView を非同期ポストバックで置き換える処理です。
非同期ポストバック自体は DropDownlist1.SelectedIndexChanged のタイミングで行われるのですが、なぜか UpdateProgress が表示されません。
ドロップダウンリストを UpdatePanel の中に入れた場合は UpdateProgress が表示されるので、 UpdateProgress の仕様っぽいです。
MicrosoftAjaxWebForms を見みると
function Sys$UI$_UpdateProgress$_startRequest() {
if (this._pageRequestManager.get_isInAsyncPostBack()) {
if (this._dynamicLayout) this.get_element().style.display = 'block';
else this.get_element().style.visibility = 'visible';
}
this._timerCookie = null;
}
UpdateProgress.get_element() の 表示状態を変更してあげればどうにかなりそう。
じゃぁこんな風にしてあげると、
DropDownList1.Attributes.Add("onchange", String.Format("$find('{0}').get_element().style.display='block';", UpdateProgress1.ClientID))
表示された。無理やりだけれど。
# もしかして表示されないの僕だけだったりする?
|
トラックバック(1件)
| タイトル (本文) |
ブログ名/日時 |
TriggerイベントでUpdateProgressを表示する
ASP.NET AJAXの解説を読んでUpdateProgressを貼り付けても、TriggerイベントではUpdateProgressが表示されません。ネットで調べるとかるあさんのブログで解決策があ
...続きを見る
|
::: studio OneStep :... 2008/02/13 19:12 |