What does DataPager do?

When i first downloaded Visual studio 9, i was little excited about the new tag called <asp:DataPager />,  when i create a new web application.
Here i m trying to describe what datapager actually is and what does it do?
The DataPager is a new ASP.NET control comibined with any  data control (such as a ListView) allows paging on that control. The great advantage of datapager control is that it can be placed anywhere between the databound control(on any template) or it can also be placed outside of the databound control. Can be refred to the bould control with PageControlId Property.  PageControlId property defines to which databound control are you associating the datapager control.

Apparently the ListView control is the only one that supports this interface (and therefore the DataPager) right now.  The ListView is very flexible. It’s completely template base and can be customized to provide output similar to a GridView if you so desire. One of the big difference between gridview and listview is that, gridivew delivers the html code always in table. You can change it but with Listview you have complete control over the html code generated so hope its helps people who likes div based layout.
The DataPager control  works with any control that implements IPageableItemContainer, which currently just includes ListView.  This interface is public so you could ideally use DataPager with custom controls as well.  You can create new custom controls or extend some existing one and make it implement the IPageableItemContainer interface.
Another great advantage of datapager is that it allows you to do paging using querystring parameters, no form postback. This is also the good news for peoples who want to create site with SEO.
, , , ,

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Share to Facebook Share to Twitter Stumble It Share on Tumblr Digg More...