关键是每个控件加一个updatepanel,然后将updatepanel其中的trigger对应2个控件所有的事件都加入,当然aspnetpager中的UrlPaging="True",改为UrlPaging="False",基本上没问题了。<div > <asp:UpdatePanel ID= " UpdatePanel1 " runat= " server " UpdateMode= " Conditional "> <ContentTemplate> <div id= " translucent "> </div> <div id= " waitLayer "> <table cellspacing= " 5 " cellpadding= " 0 " width= " 300px " bgcolor= " #f4f4f4 " align= " center "> <tbody> <tr> <td bgcolor= " #ffffff " height= " 100 " align= " middle " height= " 50px " valign= " middle "> <img src= " ../images/wait/1003.gif " width= " 14px " height= " 14px "><span id= " later ">请稍候..</span> </td> </tr> </tbody> </table> </div> <asp:Repeater ID= " RepeaterShow " runat= " server "> <HeaderTemplate> <table width= " 100% " class= " tableboder " id= " tableshow "> </HeaderTemplate> <ItemTemplate> <tr οnmοuseοver= " this.style.backgroundColor='#CCCCFF' " οnmοuseοut= " this.style.backgroundColor='' " οndblclick= " javascript:FN_UpdateFilePath(this,'',500,350) " value= ' <%#Eval("FileId") %> '> <td width= " 5% "> <input id= " item " type= " checkbox " name= " itemname " /> </td> <td width= " 5% "> <%# Container.ItemIndex+ 1%> </td> <td name= " td " style= " display: none "> <%#Eval( " FileId ") %> </td> <td width= " 20% "> <img src= " ../FileTypeimg/<%# getFileIcon( Eval( "FileNam " ).ToString()) %> " align= " middle " width= " 16 " height= " 16 " alt= " 文件类型 " /> <asp:Label ID= " lblMatNM " runat= " server " Text= ' <%#Eval("FileNam").ToString().Length >15?Eval ("FileNam").ToString ().Substring (0,15)+"...":Eval ("FileNam").ToString ()%> ' ToolTip= ' <%#Eval("FileNam")%> ' CssClass= " TextAlign "></asp:Label> </td> <td width= " 10% "> <%#Eval( " FileSize ") + " 字节 "%> </td> <td width= " 15% "> <%#Eval( " Decription ")%> </td> <td width= " 8% "> <%#DataBinder.Eval(Container.DataItem, " CreateOn ", " {0:d} ") %> </td> <td width= " 8% "> <%#DataBinder.Eval(Container.DataItem, " ModefyOn ", " {0:d} ")%> </td> <td width= " 10% "> <a value= ' <%#Eval("FilePath") %> ' href= ' ../Ajax/AjaxDownFile.ashx?id=<%#Eval("FileId")%> '> 【下载】</a> </tr> </ItemTemplate> <FooterTemplate> <%-- <asp:Label ID= " Label1 " runat= " server " Text= "" Visible= ' <%#bool.Parse((RepeaterShow.Items.Count==0).ToString())%> ' CssClass= " Text "></asp:Label>--%> </table> </FooterTemplate> </asp:Repeater> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID= " RepeaterShow " EventName= " DataBinding " /> <asp:AsyncPostBackTrigger ControlID= " RepeaterShow " EventName= " ItemDataBound " /> <asp:AsyncPostBackTrigger ControlID= " RepeaterShow " EventName= " ItemCommand " /> <asp:AsyncPostBackTrigger ControlID= " RepeaterShow " EventName= " Load " /> <asp:AsyncPostBackTrigger ControlID= " RepeaterShow " EventName= " ItemCreated " /> <asp:AsyncPostBackTrigger ControlID= " RepeaterShow " EventName= " Init " /> <asp:AsyncPostBackTrigger ControlID= " RepeaterShow " EventName= " Unload " /> <asp:AsyncPostBackTrigger ControlID= " RepeaterShow " EventName= " PreRender " /> <asp:AsyncPostBackTrigger ControlID= " RepeaterShow " EventName= " Disposed " /> </Triggers> </asp:UpdatePanel> </div><div > <asp:UpdatePanel runat= " server " UpdateMode= " Conditional " ID= " UpdatePanel2 " ChildrenAsTriggers= " false "> <ContentTemplate> <webdiyer:AspNetPager ID= " pager1 " runat= " server " AlwaysShow= " True " ShowBoxThreshold= " 2 " ShowCustomInfoSection= " Right " ShowNavigationToolTip= " True " CustomInfoHTML= " 第%CurrentPageIndex%页,共%PageCount%页,每页%PageSize%条 " SubmitButtonText= " Go " TextAfterPageIndexBox= " 页 " TextBeforePageIndexBox= " 转到 " CustomInfoSectionWidth= " 10% " PagingButtonStyle= " pages " OnPageChanging= " pager1_PageChanging " PageIndexBoxType= " DropDownList " FirstPageText= " 首页 " LastPageText= " 尾页 " NextPageText= " 下一页 " PrevPageText= " 上一页 " PageSize= " 20 " ShowPageIndexBox= " Never " CssClass= " pages " CurrentPageButtonClass= " cpb " LayoutType= " Table " CurrentPageButtonPosition= " Beginning " Wrap= " False " PagingButtonLayoutType= " Span " BorderColor= " #CCCCFF " BorderWidth= " 1px "> </webdiyer:AspNetPager> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID= " RepeaterShow " EventName= " DataBinding " /> <asp:AsyncPostBackTrigger ControlID= " RepeaterShow " EventName= " ItemDataBound " /> <asp:AsyncPostBackTrigger ControlID= " RepeaterShow " EventName= " ItemCommand " /> <asp:AsyncPostBackTrigger ControlID= " RepeaterShow " EventName= " Load " /> <asp:AsyncPostBackTrigger ControlID= " RepeaterShow " EventName= " ItemCreated " /> <asp:AsyncPostBackTrigger ControlID= " RepeaterShow " EventName= " Init " /> <asp:AsyncPostBackTrigger ControlID= " RepeaterShow " EventName= " Unload " /> <asp:AsyncPostBackTrigger ControlID= " RepeaterShow " EventName= " PreRender " /> <asp:AsyncPostBackTrigger ControlID= " RepeaterShow " EventName= " Disposed " /> </Triggers> </asp:UpdatePanel></div>
repeater+aspnetpager无刷新更新
最新推荐文章于 2019-06-25 18:52:32 发布