Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 18th, 2010, 05: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
  #2 (permalink)  
Old October 30th, 2010, 02:10 AM
Friend of Wrox
Points: 1,749, Level: 16
Points: 1,749, Level: 16 Points: 1,749, Level: 16 Points: 1,749, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: San Diego, CA, USA.
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.
  #3 (permalink)  
Old November 4th, 2010, 10: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
  #4 (permalink)  
Old November 4th, 2010, 10: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
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 11:23 AM
Paging fadyratl VB Databases Basics 0 December 27th, 2006 05:04 AM



All times are GMT -4. The time now is 03:25 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.