473,698 Members | 2,141 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.EventArg s) Handles MyBase.Load
'Put user code to initialize the page here
'Dim partoftown = Session("partof town")
' 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=findand view;trusted_co nnection=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.DataSour ce = ds.Tables(0).De faultView
objPds.AllowPag ing = True
objPds.PageSize = 5
Dim CurPage As Integer
If Not Request.QuerySt ring("Page") Is Nothing Then
CurPage = Convert.ToInt32 (Request.QueryS tring("Page"))
Else
CurPage = 1
End If

objPds.CurrentP ageIndex = CurPage - 1
lblCurrentPage. Text = "Page: " + CurPage.ToStrin g()

If Not objPds.IsFirstP age Then
lnkPrev.Navigat eUrl = Request.Current ExecutionFilePa th +
"?Page=" + Convert.ToStrin g(CurPage - 1)
End If

If Not objPds.IsLastPa ge Then
lnkNext.Navigat eUrl = Request.Current ExecutionFilePa th +
"?Page=" + Convert.ToStrin g(CurPage + 1)
End If

Repeater1.DataS ource = objPds
Repeater1.DataB ind()
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"><a sp:HyperLink id="lnkNext"
runat="server"> <img src="../buttons/next_button_06. gif" width=82
height=22></asp:HyperLink></td>

Nov 19 '05 #1
0 1087

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

Similar topics

1
4433
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" > Sub PageIndexChanged(ByVal sende.........)
2
3486
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. http://authors.aspalliance.com/aspxtreme/sys/Web/UI/WebControls/DataGridClassAllowCustomPaging.aspx (Check the example 'Custom Paging with AutoIncrement Data Model'). However, the assumption here is that the rows are all there 1,2,3,4,5,6,7,8 but that's not the case with many database tables. You can...
0
1182
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 should be able to handle large datasets in a proper and user-friendly way. I want to use a DataGrid. I also want to use the option Custom Paging. I already succeeded with using a stored procedure (adjusted downloaded code from the internet) to use...
3
5058
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
1251
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" type="xs:string" minOccurs="0" /> <xs:element name="size" type="xs:int" minOccurs="0" /> <xs:element name="filesize" type="xs:long" minOccurs="0" /> <xs:element name="date" type="xs:dateTime" minOccurs="0" /> <xs:element name="sendername" type="xs:string"...
2
2217
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
1638
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 I could bind a custom class to the datagrid. Now however, I'm worried that paging is buggered because I'm using custom classes. Should this be possible and if not, would custom paging work?
2
1785
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 like that 1 2 3 4 5 6 <Next>
0
1557
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 built-in functionality of gridviews and objectdatasource's to accomplish the same thing (w/o resorting to the 1.1 methodology). I discovered two very nice and comprehensive articles concerning this: Custom Paging in ASP.NET 2.0 with SQL Server...
0
3386
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 2005 and the likes of it. So This one works with SQL2000 What do you think?
0
8673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9156
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8892
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8860
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4614
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3043
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2327
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1998
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.