使用传呼机通过下拉列表数据更新转发器 [英] Update repeater by dropdownlist data with pager

查看:105
本文介绍了使用传呼机通过下拉列表数据更新转发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我正在使用一个转发器和一个下拉列表框.根据选择的下拉列表数据,转发器绑定了数据.但是当我在转发器上使用分页时,它不仅可以正确绑定数据,而且有时还会出现View State错误.请给我

Dear All,

I am using a repeater and a dropdownlist box.According to dropdownlist data selected,the repeater binds the data.But when I used paging on the repeater, it not only binds the data properly but also some times error of View State.Please give me the solution for the repeater having pager.

推荐答案

如果将Dropdownlist与AutoPostBack ="true"一起使用,
If you are using Dropdownlist with AutoPostBack="true"
<asp:DropDownList ID="drp1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="drp1_SelectedIndexChanged">   </asp:DropDownList>


在后面的代码中


on code behind

protected void drp1_SelectedIndexChanged(object sender, EventArgs e)
   {
       ViewState["CurrentPageIndex"] = null;//clear viewstate
       bindrepeater();//bind your repeater here

   }





http://anzme.blogspot.com/2008/10/simple-numeric- pagination-for-datalist.html [ ^ ]

可能会帮助您





http://anzme.blogspot.com/2008/10/simple-numeric-pagination-for-datalist.html[^]

may help you


在下拉列表的选定更改事件中写入绑定中继器代码...
Write binding repeater code in Dropdown list''s selected change event dude...


这篇关于使用传呼机通过下拉列表数据更新转发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆