473,721 Members | 1,763 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 1089

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

Similar topics

1
4441
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
3487
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
5061
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
2221
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
1642
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
1788
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
1558
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
3390
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
8840
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
8730
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9367
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...
0
9215
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9064
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...
0
8007
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4484
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2130
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.