VB paging code not working?

Discussion in 'ASP .Net Web Controls' started by pj, Jun 22, 2004.

  1. pj

    pj Guest

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

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

    Thanks in advance,

    --
    pj
     
    pj, Jun 22, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Coleen

    Datagrid Paging not working

    Coleen, Dec 31, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    4,503
    Coleen
    Dec 31, 2003
  2. =?Utf-8?B?UGF0cmljay5PLklnZQ==?=

    DataSet paging vs Datareader paging

    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Oct 8, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    10,772
    Scott Allen
    Oct 8, 2004
  3. wh1974
    Replies:
    0
    Views:
    2,451
    wh1974
    Jan 12, 2005
  4. Red
    Replies:
    1
    Views:
    733
  5. Ryan Rueckl

    DataGris Paging not working (event not firing)

    Ryan Rueckl, Jun 22, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    8
    Views:
    199
    Ryan Rueckl
    Jun 24, 2005
Loading...

Share This Page