如题:
一个asp页面上已经放置了相关的ajax控件,但是如何在页面载入(要求page_load)时 显示一下 Updateprogress模块的内容,载入完毕取消显示
同时 不能用 Response.Write会破坏原有架构
代码如下:<html>
<head runat="server">
<title>信息查询展示区</title>
<link href="../BaseCSS.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" type ="text/javascript">
<!--
Image01= new Image(100,50) ;
Image01.src = "../Picture/gohome.jpg" ;
-->
</script>
</head><body topmargin=0 leftmargin =0 >
<form runat=server> <div runat="server">
<table style="width: 99.5%;" align="center" >
<tr class="FontBase">
<td>
<asp:Button ID="ButtonSearch" runat="server" Text="查询" Font-Size="12px"
onclick="ButtonSearch_Click" />
</td>
</tr>
</table>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table style="width: 99.5%;" align="center" > <tr>
<td align=center>
<asp:Panel ID="Panel1" runat="server" ScrollBars="Auto" Width="100%">
<asp:GridView ID="GridView1" runat="server" Width="100%"
BorderColor="#4AADCD" BorderStyle="NotSet" BorderWidth="1px" CellPadding="2"
AllowPaging="True" PageSize="15" Font-Size="12px"
onpageindexchanging="GridView1_PageIndexChanging" AllowSorting="True"
onsorting="GridView1_Sorting" onrowdatabound="GridView1_RowDataBound" EmptyDataText="查无信息."
OnRowCreated="GridView1_RowCreated"
>
<FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
<RowStyle BackColor="White" ForeColor="#003399" Wrap="false" />
<PagerSettings Visible = "true" />
<SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
<HeaderStyle BackColor="#F8EDB6" Font-Bold="True" ForeColor="#003399" />
<pagertemplate>
<table width="100%" bgcolor="#CCCCFF" cellspacing="0" border="0">
<tr>
<td style="text-align:left">
<asp:Label id="lblCount" runat="server"></asp:Label>
第<asp:Label id="Label1" runat="server" text='<%# ((GridView)Container.Parent.Parent).PageIndex+1 %>' />页
共<asp:Label id="lblPageCount" runat="server" text='<%# ((GridView)Container.Parent.Parent).PageCount %>' />页
<asp:linkbutton id="btnFirst" runat="server" causesvalidation="False" commandargument="First" commandname="Page" text="首页" />
<asp:linkbutton id="btnPrev" runat="server" causesvalidation="False" commandargument="Prev" commandname="Page" text="上一页" />
<asp:linkbutton id="btnNext" runat="server" causesvalidation="False" commandargument="Next" commandname="Page" text="下一页" />
<asp:linkbutton id="btnLast" runat="server" causesvalidation="False" commandargument="Last" commandname="Page" text="尾页" />
<asp:textbox id="txtNewPageIndex" CssClass="FontBase" runat="server" width="30px" text='<%# ((GridView)Container.Parent.Parent).PageIndex + 1 %>' />
<asp:linkbutton id="btnGo" runat="server" causesvalidation="False" commandargument="-1" commandname="Page" text="跳转" /><!-- here set the CommandArgument of the Go Button to '-1' as the flag -->
</td>
</tr>
</table>
</pagertemplate>
</asp:GridView>
</asp:Panel>
</td> </tr>
<tr>
<td align="left">
<asp:Label ID="LabelRes" runat="server" Text="Label" Font-Size="12px"
BorderStyle="None" style="text-align: left"></asp:Label>
<asp:Label ID="LabelFirstShow" runat="server" Text="Label" Font-Size="20px" ForeColor="BlueViolet"
BorderStyle="None" style="text-align: left"></asp:Label>
<asp:Label ID="LabelSearchFilter" runat="server" Font-Size="11px"
ForeColor="#0066FF" Text=""></asp:Label> <Br>
<asp:HyperLink ID="HyperLink1" runat="server" ImageUrl="../Picture/gohome.jpg" NavigateUrl="../Default.aspx" Target="_top"></asp:HyperLink>
</td>
</tr>
</table>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ButtonSearch" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgressWait" runat="server">
<ProgressTemplate>
<div style="position:absolute;left:48%;top:20%;height:17px;width:80px; text-align:center;
background-color:#F8EDB6;filter:alpha(opacity=100); ">
<a style="font-size:13px; color:Blue;">请您稍等...</a>
<img alt="" id="picA" src="../Picture/ajax-loader.gif" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</div>
</form>
</body>
</html>
一个asp页面上已经放置了相关的ajax控件,但是如何在页面载入(要求page_load)时 显示一下 Updateprogress模块的内容,载入完毕取消显示
同时 不能用 Response.Write会破坏原有架构
代码如下:<html>
<head runat="server">
<title>信息查询展示区</title>
<link href="../BaseCSS.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" type ="text/javascript">
<!--
Image01= new Image(100,50) ;
Image01.src = "../Picture/gohome.jpg" ;
-->
</script>
</head><body topmargin=0 leftmargin =0 >
<form runat=server> <div runat="server">
<table style="width: 99.5%;" align="center" >
<tr class="FontBase">
<td>
<asp:Button ID="ButtonSearch" runat="server" Text="查询" Font-Size="12px"
onclick="ButtonSearch_Click" />
</td>
</tr>
</table>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table style="width: 99.5%;" align="center" > <tr>
<td align=center>
<asp:Panel ID="Panel1" runat="server" ScrollBars="Auto" Width="100%">
<asp:GridView ID="GridView1" runat="server" Width="100%"
BorderColor="#4AADCD" BorderStyle="NotSet" BorderWidth="1px" CellPadding="2"
AllowPaging="True" PageSize="15" Font-Size="12px"
onpageindexchanging="GridView1_PageIndexChanging" AllowSorting="True"
onsorting="GridView1_Sorting" onrowdatabound="GridView1_RowDataBound" EmptyDataText="查无信息."
OnRowCreated="GridView1_RowCreated"
>
<FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
<RowStyle BackColor="White" ForeColor="#003399" Wrap="false" />
<PagerSettings Visible = "true" />
<SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
<HeaderStyle BackColor="#F8EDB6" Font-Bold="True" ForeColor="#003399" />
<pagertemplate>
<table width="100%" bgcolor="#CCCCFF" cellspacing="0" border="0">
<tr>
<td style="text-align:left">
<asp:Label id="lblCount" runat="server"></asp:Label>
第<asp:Label id="Label1" runat="server" text='<%# ((GridView)Container.Parent.Parent).PageIndex+1 %>' />页
共<asp:Label id="lblPageCount" runat="server" text='<%# ((GridView)Container.Parent.Parent).PageCount %>' />页
<asp:linkbutton id="btnFirst" runat="server" causesvalidation="False" commandargument="First" commandname="Page" text="首页" />
<asp:linkbutton id="btnPrev" runat="server" causesvalidation="False" commandargument="Prev" commandname="Page" text="上一页" />
<asp:linkbutton id="btnNext" runat="server" causesvalidation="False" commandargument="Next" commandname="Page" text="下一页" />
<asp:linkbutton id="btnLast" runat="server" causesvalidation="False" commandargument="Last" commandname="Page" text="尾页" />
<asp:textbox id="txtNewPageIndex" CssClass="FontBase" runat="server" width="30px" text='<%# ((GridView)Container.Parent.Parent).PageIndex + 1 %>' />
<asp:linkbutton id="btnGo" runat="server" causesvalidation="False" commandargument="-1" commandname="Page" text="跳转" /><!-- here set the CommandArgument of the Go Button to '-1' as the flag -->
</td>
</tr>
</table>
</pagertemplate>
</asp:GridView>
</asp:Panel>
</td> </tr>
<tr>
<td align="left">
<asp:Label ID="LabelRes" runat="server" Text="Label" Font-Size="12px"
BorderStyle="None" style="text-align: left"></asp:Label>
<asp:Label ID="LabelFirstShow" runat="server" Text="Label" Font-Size="20px" ForeColor="BlueViolet"
BorderStyle="None" style="text-align: left"></asp:Label>
<asp:Label ID="LabelSearchFilter" runat="server" Font-Size="11px"
ForeColor="#0066FF" Text=""></asp:Label> <Br>
<asp:HyperLink ID="HyperLink1" runat="server" ImageUrl="../Picture/gohome.jpg" NavigateUrl="../Default.aspx" Target="_top"></asp:HyperLink>
</td>
</tr>
</table>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ButtonSearch" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgressWait" runat="server">
<ProgressTemplate>
<div style="position:absolute;left:48%;top:20%;height:17px;width:80px; text-align:center;
background-color:#F8EDB6;filter:alpha(opacity=100); ">
<a style="font-size:13px; color:Blue;">请您稍等...</a>
<img alt="" id="picA" src="../Picture/ajax-loader.gif" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</div>
</form>
</body>
</html>
加载完毕隐藏,你怎么写的?