Wrox Programmer Forums
|
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 18th, 2010, 04:24 AM
Authorized User
 
Join Date: Oct 2010
Posts: 17
Thanks: 0
Thanked 1 Time in 1 Post
Default Paging

Hello Every body
Please help me how can i write code in order to << Previous Article and Next Article >> page

E.x
i am viewing a record 5 and

<< Previous Article is 4

Next Article >> is 6
------------------------
<< Previous Article

Continue reading and see our next or previous articles

Next Article >>

I really appreciate all the help you can give me!
Thanks in advance

Phuc Hoang
 
Old October 30th, 2010, 01:10 AM
Friend of Wrox
 
Join Date: Jun 2007
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

I find links are really good for this. Set up your webpage so that the record is determined by a variable in the querystring, e.g. Your dynamic webpage has a link that looks like this "http://www.domain.com/path/to/file.aspx?page=5". In the code behind, you can retrieve the page using...

string pageIndex = HttpContext.Current.Request["page"];

Then you simply create the links for the for the paging...

string pageUrl = "http://www.domain.com/path/to/file.aspx";
string previousLink = "<a href=\"" + pageUrl + "?page=" + (pageIndex - 1) + "\">&lt;&lt; Previous Article</a>";
string nextLink = "<a href=\"" + pageUrl + "?page=" + (pageIndex + 1) + "\">Next Article &gt;&gt;</a>";
__________________
-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
 
Old November 4th, 2010, 09:04 PM
Authorized User
 
Join Date: Oct 2010
Posts: 17
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thanks for helping me, It great
 
Old November 4th, 2010, 09:04 PM
Authorized User
 
Join Date: Oct 2010
Posts: 17
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thanks for helping me. It's great





Similar Threads
Thread Thread Starter Forum Replies Last Post
Paging in listview, using paging in stored procedures philthy BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 November 11th, 2012 07:03 PM
Paging sophia BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 10 December 4th, 2009 02:19 PM
DB recordset paging using ajax paging? kumiko Classic ASP Basics 0 May 26th, 2008 10:23 AM
Paging fadyratl VB Databases Basics 0 December 27th, 2006 05:04 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.