Datalist pager - It thinks it works but it doesn't adjust page size

I am a newbie who has followed a tutorial re a datalist pager. The tutrial expects its students to be more experienced than me. ie it expects students to know what goes at the top of the code behind page ( “imports” in VB / “using” in C# ) and I think it expects students to adjust Visual Studio property / events without any guidence. I have managed the “using” ( top of code behind ) and most of the adjustments in VWD user interface properties window but it appears that I am missing one vital ingredient.

My actual pager control ( see here - ) is behaving just as it would if it was working properly but it is not adjusting the amount of records on the page. It’s a little slow ( attached to many db records ) so below I say what it actually does do :

It knows how many records are in the db field because it diplays the right amount of page numbers and it adjusts the amount of page numbers according to the page size options in its dropdown list.

It highlights which page it believes it is on once a user chooses a page.

It knows which page it is supposed to be displaying - ie “previous” and “next” buttons react properly re clicking on last link or first link.

I think the problem is in the properties events section of VWD user interface or is another very basic mistake because I am as sure as I can be that my code is the same as the lessons which gets excellent response reviews from very many other people who have used it.

I am asking this question in the hope that there may be a simple answer available or so that I can get indication of what could be wrong in order to be able to post a properly described and concise question along with my code.

Lesson I followed is here - - and its working example is here -

Please can anyone help?

Can you post some of your code? As there is no use in us trying to speculate what is going wrong. Will be a lot easier to diagnose when we can see the code.

Thanks for responding NightStalker,

I attach the .aspx page and the .aspx.cs page in a zip folder. These are not busy pages so I hope you dont mind me attaching the whole pages. For your info, these pages are only used in order to try and follow the tutorial re the datalist pager - any other html on .aspx is because I use a copy of another page ( ) as a template to do the tutorial ( but with original datalist and its parameter controls removed ). If you prefer me to send the pages somehow differently or as plain text please let me know.
There are no squiggly lines under code in either of the pages.

Re the files I have sent:
The .aspx page has 2 datalists - the 2nd one on the page is the main datalist used to display a long list of product. Above that is the datalist and its associated link buttons which use the code behind page to become a pager, as per the tutorial I have followed ( tutorial link at the botttom of my previous post if that’s helpful ).

If its any help - I think the likely foundation of my mistake is basic - along the lines of this being the first I have ever used C# instead of having the pageset up for VB - or my very limited knowledge re which events or properties to adjust from the default settings in my VWD 2008 express user interface to implement the pager. I adjusted a few events connected to the paging datalist and its associated controls which did made the controls on the pager spring to life.

One thing I may have wrong is that I have had to make a guess at where “page scope” is on the code behind page. Tutorial says to put “PagedDataSource pds = new PagedDataSource();” at page scope.

Thanks for any help you can offer :slight_smile:

SORTED - IT WORKS !! After much brain sapping - a combination of simple errors - me newbie - please forgive.

Cool, no problem. Glad its sorted. And before I even had a chance to look at the code. Nicely done