Click here to Skip to main content
16,004,806 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
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.
Posted
Comments
thatraja 4-Aug-11 23:15pm    
Include the error message in your question

If you are using Dropdownlist with AutoPostBack="true"
XML
<asp:DropDownList ID="drp1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="drp1_SelectedIndexChanged">   </asp:DropDownList>

on code behind
C#
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[^]

may help you
 
Share this answer
 
Comments
PrafullaSoftEngineer 13-Aug-11 4:15am    
Thank you.I will definately try this.
Write binding repeater code in Dropdown list's selected change event dude...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900