473,396 Members | 1,927 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem using custom paging

Trying to page results from a repeater. The resulting hyperlinks point o
empty references when the page is run. No errors show up

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
'Dim partoftown = Session("partoftown")
' Dim partoftown = "kensington"

Dim conPubs As SqlConnection
Dim cmdSelect As SqlCommand
Dim dtrAuthors As SqlDataReader
Dim objConn As SqlConnection = New SqlConnection("Data
Source=server1;Initial Catalog=findandview;trusted_connection=true;")
Dim objCommand As SqlDataAdapter = New SqlDataAdapter("Select *
from maintable where area = 'Kensington'", objConn)
Dim ds As DataSet = New DataSet
objCommand.Fill(ds)

Dim objPds As PagedDataSource = New PagedDataSource
objPds.DataSource = ds.Tables(0).DefaultView
objPds.AllowPaging = True
objPds.PageSize = 5
Dim CurPage As Integer
If Not Request.QueryString("Page") Is Nothing Then
CurPage = Convert.ToInt32(Request.QueryString("Page"))
Else
CurPage = 1
End If

objPds.CurrentPageIndex = CurPage - 1
lblCurrentPage.Text = "Page: " + CurPage.ToString()

If Not objPds.IsFirstPage Then
lnkPrev.NavigateUrl = Request.CurrentExecutionFilePath +
"?Page=" + Convert.ToString(CurPage - 1)
End If

If Not objPds.IsLastPage Then
lnkNext.NavigateUrl = Request.CurrentExecutionFilePath +
"?Page=" + Convert.ToString(CurPage + 1)
End If

Repeater1.DataSource = objPds
Repeater1.DataBind()
End Sub

....
in ASP

<td valign="top" align="right" width="82"><asp:HyperLink id="lnkPrev"
runat="server"><img src="../buttons/previous_button_06.gif" width=82
height=22></asp:HyperLink></td>

<td width="82" valign="top" align="left"><asp:HyperLink id="lnkNext"
runat="server"><img src="../buttons/next_button_06.gif" width=82
height=22></asp:HyperLink></td>

Nov 19 '05 #1
0 1073

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Alex | last post by:
I created a page to show RealEstate Data with images retrived from the MSSQL 2000. I am using a DataGrid control: <asp:datagrid AllowPaging="True" OnPageIndexChanged="Pageindexchanged" > ...
2
by: Maziar Aflatoun | last post by:
Hi, I'm having problems with Custom Paging. Most of the articles out there show that the custom paging is done as the following article. ...
0
by: Jos Walrave | last post by:
I want to create an ASP.NET web application using C#. Purpose of the web application is access to a MS SQL Server database. Some of our customers are using large databases, so the application...
3
by: Clint | last post by:
Hi, I am trying to implement the custom paging in the datalist in this format: << Prev 1,2,3,4,5 Next >>. Does anyone knows how to do this. Thanks in advance. Clint
0
by: Raed Sawalha | last post by:
I have aspx page with user control , in the user control i have DataGrid with custom paging the grid is displaying contents of datatable as following schema <xs:element name="id"...
2
by: asad | last post by:
Hello friends, i am designing a ASP.NET page where i want to use custom paging bcoz data is too heavy so pls tell me how can i use custom paging in ASP.NET Thanks
1
by: thechaosengine | last post by:
Hi all, Can somebody tell me if the built in paging support for the datagrid works when using a custom collection and a custom business object as the data. I was well pleased when I found that...
2
by: asad | last post by:
hello friends, how ru all I want to create a custom paging logic in ASP.NET with a next link for example if i have 100 pages record so i want to show 6 pages link on page one and next link ...
0
by: Roy | last post by:
Hey all, I must be losing my touch. I have made many pages in the 1.1 framework that utilize custom bidirectional paging in datagrids. We've converted over to 2.0 and I've been trying to use the...
0
by: anonieko | last post by:
This approach I found very efficient and FAST when compared to the rowcount, or Subquery Approaches. This is before the advent of a ranking function from DB such as ROW_NUMBER() in SQL Server...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.