VB paging code not working?

P

pj

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">
<iewc:pageView>
<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>
</iewc:pageView>

<iewc:pageView>
<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>
</iewc:pageView>

<iewc:pageView>
<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>
</iewc:pageView>

</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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top