473,769 Members | 4,584 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamic linksbuttons, VB Class File and custom paging help needed

OK, Im finished pulling my hair out and now I need help. I have created
a VB class file for my custom paging, in it I create a table with 2
rows, in the rows I have linkbuttons for first page, previous page,
next page and last page. The buttoms are created like:
CODE
'configure the link buttons
link_1.ID = "f_link"
link_2.ID = "p_link"
link_3.ID = "n_link"
link_4.ID = "l_link"

link_1.Text = "<< First"
link_2.Text = "< Prev"
link_3.Text = "Next >"
link_4.Text = "Last >>"

link_1.CommandA rgument = "FirstPage"
link_2.CommandA rgument = "PreviousPa ge"
link_3.CommandA rgument = "NextPage"
link_4.CommandA rgument = "LastPage"
AddHandler link_1.Command, AddressOf link_click
AddHandler link_2.Command, AddressOf link_click
AddHandler link_3.Command, AddressOf link_click
AddHandler link_4.Command, AddressOf link_click

link_1.CausesVa lidation = False
link_2.CausesVa lidation = False
link_3.CausesVa lidation = False
link_4.CausesVa lidation = False

in the class file I have serveral properties :

CODE
Public Property DG_Name() As String
Get
Return DGname
End Get
Set(ByVal value As String)
DGname = value
End Set
End Property

Public Property page_num() As Integer
Get
Return my_page
End Get
Set(ByVal value As Integer)
my_page = value
End Set
End Property

Public Property tot_records() As Integer
Get
Return total_records
End Get
Set(ByVal value As Integer)
total_records = value
End Set
End Property

Public Property MyDG() As DataGrid
Get
Return DG
End Get
Set(ByVal value As DataGrid)
DG = value
End Set
End Property

and the variables are declared here:
CODE
Public DG As DataGrid = New DataGrid
Public my_page As Integer
Public total_records As Integer
Public DGname As String

The link_click event is as such:
CODE
Public Sub link_click(ByVa l sender As Object, ByVal e As
CommandEventArg s)
Dim lb As LinkButton = CType(sender, LinkButton)

Select Case lb.CommandArgum ent.ToString.To Lower
Case "firstpage"
DG.CurrentPageI ndex = 0
HttpContext.Cur rent.Response.W rite("you clicked " &
lb.CommandArgum ent.ToString)
Case "previouspa ge"
If DG.CurrentPageI ndex = 0 Then
DG.CurrentPageI ndex = 0
Else
DG.CurrentPageI ndex = page_num - 1
End If
HttpContext.Cur rent.Response.W rite("you clicked " &
lb.CommandArgum ent.ToString)
Case "nextpage"
HttpContext.Cur rent.Response.W rite(tot_record s & "
:: " & my_page & " :: ")
If (total_records - 1) < page_num Then
DG.CurrentPageI ndex = 0
Else
DG.CurrentPageI ndex = page_num + 1
End If
HttpContext.Cur rent.Response.W rite("you clicked " &
lb.CommandArgum ent.ToString)

Case "lastpage"
HttpContext.Cur rent.Response.W rite("you clicked " &
lb.CommandArgum ent.ToString)
DG.CurrentPageI ndex = CType((DG.PageC ount),
Integer)
End Select
End Sub

The response.writes work and tell me what I clicked, in the .aspx.vb
file I set the properties in the class file as such:
CODE
page.my_page = bud_pricing.Cur rentPageIndex
name.DG_Name = "bud_pricin g"
records.total_r ecords = Rec_Count
DG.DG = bud_pricing

The values set in the aspx.vb file arent getting to the class file so
the paging dont work. The links show up beautifully but they dont page.
Can someone PLEASE help me?

Sep 22 '06 #1
0 1400

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

Similar topics

0
1628
by: Stephen | last post by:
This is a real brain-teaser and i'd really appreciate it if someone can try and understand what im trying to do and give me a few pointers or ideas to help me work out my problem. Im basically using the example of CUSTOM PAGING on a DataGrid on this page: http://www.dotnetjunkies.com/Tutorial/EA868776-D71E-448A-BC23-B64B871F967F.dcik and im trying to add extra functionality in the DataGrid Paging - Custom Paging example. I'm able to get...
2
1685
by: raymi | last post by:
Hi, I have a custom class that gets its properties dynamically from a database at runtime. Therefore I implemented the ICustomTypeDescriptor in this class and created a a custom PropertyDescriptor. The custom class also inherits from Component and therefore can be dragged on the form in the designer view. So far so good, I can bind properties from my class to textboxes etc. But when I try to bind an ArrayList containig instances of my...
3
3040
by: David Whitney | last post by:
All: I have a control that renders a table. As the table is rendered, each row in the table is constructed by creating a run-time (dynamic) object that is derived from an HtmlTableRow. The row has three HtmlTableCell objects, and each cell contains a single control added to the HtmlTableCell's Controls collection. The basic table renders correctly, but the controls within the HtmlTableCell objects do not; the cells are just empty. (Just...
1
7587
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a dropdown in UC1 _________________________ 1) MainPage_Load 2) User Control_1 Load
3
5063
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
2
2225
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
2
1790
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>
7
2331
by: =?Utf-8?B?SmVmZiBCZWVt?= | last post by:
The default paging behavior of the gridview doesn't work well with very large sets of data which means we have to implement some sort of custom paging. The examples I have seen (4guysfromrolla, etc.) suggest using an ObjectDataSource which has built-in paging functionality that, when used in conjunction with certain SQL 2005 functionality, only works with the records to be displayed on the page rather than the entire set. The problem with...
2
4464
Frinavale
by: Frinavale | last post by:
I've created a ASP.NET control that displays a "book" of schedules. It dynamically displays scheduling times and allows the user to page through the schedules. It also lets the user edit the schedule times if the user has permissions to edit schedules. When the user is not editing, or the user is not allowed to edit, the buttons that let the user edit are not displayed. If the user is allowed to edit schedules but they are not editing a link...
0
9423
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
10211
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
10045
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
8870
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
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3958
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
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
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.