Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > VB paging code not working?

Reply
Thread Tools

VB paging code not working?

 
 
pj
Guest
Posts: n/a
 
      06-22-2004
I copied some sample code from dotnetextreme for a mutipage/pageview web form but the next/prev link buttons don't seem to work. Can anyone take a look and see what I'm doing wrong?

MultiPage.aspx
--------------------------------------------------------------------------
<%@ Page Language="vb" autoeventwireup="false" Src="MultiPage.aspx.vb" %>
<%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>

<HEAD>
<title>MultiPage Control</title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>

<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">

<iewc:MultiPage id="MultiPage_Control" style="Z-INDEX: 101; LEFT: 5px; POSITION: absolute; TOP: 6px" runat="server" Height="302px" Width="631px">
<iewcageView>
<asp:Label id="address_label" style="Z-INDEX: 108; LEFT: 15px; POSITION: absolute; TOP: 148px" runat="server">Address</asp:Label>
<asp:Label id="lname_label" style="Z-INDEX: 107; LEFT: 13px; POSITION: absolute; TOP: 106px" runat="server">Last Name</asp:Label>
<asp:Label id="fname_label" style="Z-INDEX: 106; LEFT: 12px; POSITION: absolute; TOP: 70px" runat="server">First Name</asp:Label>
<asp:TextBox id="address" style="Z-INDEX: 105; LEFT: 109px; POSITION: absolute; TOP: 145px" runat="server" TextMode="MultiLine"></asp:TextBox>
<asp:TextBox id="lname" style="Z-INDEX: 104; LEFT: 110px; POSITION: absolute; TOP: 108px" runat="server"></asp:TextBox>
<asp:TextBox id="fname" style="Z-INDEX: 103; LEFT: 109px; POSITION: absolute; TOP: 70px" runat="server"></asp:TextBox>
<asp:Label id="personal_info" style="Z-INDEX: 102; LEFT: 12px; POSITION: absolute; TOP: 43px" runat="server" Font-Bold="True">Personal Information</asp:Label>
</iewcageView>

<iewcageView>
<asp:Label id="password_label" style="Z-INDEX: 107; LEFT: 13px; POSITION: absolute; TOP: 106px" runat="server">Password</asp:Label>
<asp:TextBox id="password" style="Z-INDEX: 104; LEFT: 110px; POSITION: absolute; TOP: 108px" runat="server" TextMode="Password"></asp:TextBox>
<asp:Label id="userid_label" style="Z-INDEX: 106; LEFT: 12px; POSITION: absolute; TOP: 70px" runat="server">User ID</asp:Label>
<asp:TextBox id="userid" style="Z-INDEX: 103; LEFT: 109px; POSITION: absolute; TOP: 70px" runat="server"></asp:TextBox>
<asp:Label id="account_info" style="Z-INDEX: 102; LEFT: 12px; POSITION: absolute; TOP: 43px" runat="server" Font-Bold="True">Account Information</asp:Label>
</iewcageView>

<iewcageView>
<asp:Label id="agreement" style="Z-INDEX: 102; LEFT: 12px; POSITION: absolute; TOP: 43px" runat="server" Font-Bold="True">Agreement</asp:Label>
<asp:Label id="agreement_contents" style="Z-INDEX: 104; LEFT: 12px; POSITION: absolute; TOP: 70px" runat="server">The contents of the site should be kept confidential</asp:Label>
<br><br>
<asp:Button id="cancel_button" style="Z-INDEX: 103; LEFT: 115px; POSITION: absolute; TOP: 106px" runat="server" Font-Bold="True" Text="Cancel"></asp:Button>
<asp:Button id="submit_button" style="Z-INDEX: 102; LEFT: 12px; POSITION: absolute; TOP: 106px" runat="server" Font-Bold="True" Text="Submit"></asp:Button>
</iewcageView>

</iewc:MultiPage>

<asp:LinkButton id="next_link" style="Z-INDEX: 103; LEFT: 84px; POSITION: absolute; TOP: 230px" runat="server">Next</asp:LinkButton>
<asp:LinkButton id="prev_link" style="Z-INDEX: 102; LEFT: 21px; POSITION: absolute; TOP: 230px" runat="server">Prev</asp:LinkButton>
</form>
</body>
</HTML>
-----------------------------------------------------------------------

MultiPage.aspx.vb
------------------------------------------------------------------------
Public Class MultiPage
Inherits System.Web.UI.Page
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents Button2 As System.Web.UI.WebControls.Button
Protected WithEvents prev_link As System.Web.UI.WebControls.LinkButton
Protected WithEvents MultiPage_Control As Microsoft.Web.UI.WebControls.MultiPage
Protected WithEvents agreement_contents As System.Web.UI.WebControls.Label
Protected WithEvents next_link As System.Web.UI.WebControls.LinkButton

Dim current_index As Integer
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
current_index = MultiPage_Control.SelectedIndex
next_link.Enabled = True
prev_link.Enabled = False
End Sub

Private Sub LinkButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles prev_link.Click
MultiPage_Control.SelectedIndex = current_index - 1
Select Case (MultiPage_Control.SelectedIndex)
Case 0
next_link.Enabled = True
prev_link.Enabled = False

Case 1
next_link.Enabled = True
prev_link.Enabled = True

Case 2
next_link.Enabled = False
prev_link.Enabled = True
End Select

End Sub

Private Sub LinkButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles next_link.Click
MultiPage_Control.SelectedIndex = current_index + 1
Select Case (MultiPage_Control.SelectedIndex)
Case 0
next_link.Enabled = True
prev_link.Enabled = False

Case 1
next_link.Enabled = True
prev_link.Enabled = True

Case 2
next_link.Enabled = False
prev_link.Enabled = True
End Select
End Sub

End Class
-------------------------------------------------------------------------------

ASP.NET 1.1 on Windows 2003 server. WebMatrix webserver.

Thanks in advance,

--
pj
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gridview bound with Code not allowing paging jerrygp@gmail.com ASP .Net 1 04-03-2007 01:22 AM
Combining numeric mode paging and nextPreview paging in datagrid Red ASP .Net 1 03-12-2005 11:41 PM
datagrid paging - customising paging style wh1974 ASP .Net 0 01-12-2005 03:48 PM
DataSet paging vs Datareader paging =?Utf-8?B?UGF0cmljay5PLklnZQ==?= ASP .Net 1 10-08-2004 02:13 PM
Paging Dr. Who, Paging Dr. Who... Father_Sicko@TheOrphanage.com Computer Security 1 07-02-2004 08:59 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57