Beklo Home - Create your own free Blog. Upload Songs,Make Albums - Click Here to Signup
Tutorials Related to Sql ,Dotnet and Dotnet Faqs

Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount

Posted on 2007-Dec-18 at 03:30 in ASP.NET

Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount..


How to Prevent This Error in asp.net

 

We will get this error when ever we are in the second page in the datagrid or grid view and clicking on the search button or performing any action like binding the data to grid.

 

I got this error recently (Invalid CurrentPageIndex value. It must be >= 0 and < the Page Count) and I soled like this.

 

 In the datagrid I was in the second page and I clicked on the search button…before binding the data to  datagrid ..i got the following error..

 

Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount

 

Means u r in the second page then..cuurrentpageindex=1

 

After clicking on the search button make the currentpageindex=0

Then bind the data to grid.

 

Like this

 

private void btnSearch_Click (object sender, System.EventArgs e)

                   {

                 datagrid.CurrentPageIndex=0;

                             BindGrid ();   

                   }

Read my more asp.net articles at

comparing the two dates in c#

 

common elements from the two arrays

 

Exporting Datagrid to excel or worddoc using asp.net

 

Sending email using asp.net1.1

 


Last Page | Page 11 of 27 | Next Page

Links

- Home
- My Profile
- Archives
- Site Feed
- Friends
- My Photo Album
-Technorati Profile
-Blogarama
-
eXTReMe Tracker
>
Add to Technorati Favorites

Friends