Problem with Server Side Text Boxes

Discussion in 'ASP.NET / ASP.NET Core' started by jazzcatone, May 15, 2006.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hello and thank you for taking a moment to read this message. I have just uploaded some files to the DiscountASP ftp server for my new site. My code uses mostly ASP.NET 1.1. I am having a hard time getting my text boxes to display correctly. When I go to run the page, it builds but my server side text boxes are missing. IE is giving me info about a parser error. It says it expects a semicolon on line 7 of my code. Line 7 currently looks like this:

    Sub Button_Click(s As Object, e As EventArgs)

    If anybody has any suggestions it would be greatly appreciated. My code is below. Thank You.

    Jason
    ---------------------------------------------------------------------------
    <%@ Page Language="VB" Debug="true" %>
    <%@ Register TagPrefix="Electronic" TagName="Header" Src="Header.ascx" %>
    <%@ import Namespace="System.Data" %>
    <%@ import Namespace="System.Data.OleDb" %>
    <script runat="server">
    Sub Button_Click(S as Object; e As EventArgs)

    Dim conUsers As OleDbConnection
    Dim cmdSelectUsers As OleDbCommand
    Dim dtrUsers As OleDbDataReader
    Dim strConnection As String = ConfigurationManager.AppSettings("Contacts")
    conUsers = New OleDbConnection( strConnection )
    conUsers.Open()
    cmdSelectUsers = New OleDbCommand( "Select * From logins Where username=@unsername AND password=@password", conUsers )
    cmdSelectUsers.Parameters.AddWithValue("@username", txtUsername.Text)
    cmdSelectUsers.Parameters.AddWithValue("@password", txtpassword.Text)
    dtrUsers = cmdSelectUsers.ExecuteReader()
    If dtrUsers.Read Then
    Response.Redirect("Address_Insert.aspx")
    Else
    lblError.Text= ("We're sorry !! We could not find your information in our database. Please Contact Jason Livengood at ([email protected]) to find out your username and password!")
    End If
    dtrUsers.Close()
    conUsers.Close()

    End Sub
    </script>
    <html>
    <head>
    <link href="Address.css" type="text/css" rel="stylesheet" />
    </head>

    <Electronic:Header id="UserControl1" Runat="Server"></Electronic:Header>

    <div align="center">
    <marquee scrollamount="1" direction="up" loop="true" width="55%" bgcolor="#000080">
    <center><font color="#ffffff" size=+1><strong>Thank you for accepting our invitation
    to enter your information into the electronic address book. You must first enter the
    username and password you were given in your email. You will then submit your contact
    information and an email will be sent confirming that you have been entered into our
    database!</strong></font>
    </center>
    </marquee>
    </div>


    <asp:Label id="lblError" forecolor="Green" font-italic="True" font-bold="True" runat="Server"></asp:Label>
    <table align="center" colspan="2">
    <!-- Insert content here -->
    <form runat="Server">
    <tbody>
    <tr>
    <td colspan="1">
    <span class="redbold">username:</span>
    </td>
    <td>
    <asp:TextBox id="txtUsername" Runat="Server" Width="200px"></asp:TextBox>
    <asp:ReqiredFieldValidator runat="Server" ControltoValidate="txtUserName" ErrorMessage="Username is Required" Display="Dynamic">
    </td>
    </tr>
    <tr>
    <td colspan="1">
    <span class="redbold">password:</span>
    </td>
    <td>
    <asp:TextBox id="txtpassword" Runat="Server" Width="200px"></asp:TextBox>
    <asp:ReqiredFieldValidator runat="Server" ControltoValidate="txtPassword" ErrorMessage="Username is Required" Display="Dynamic">
    </td>
    </tr>
    <tr>
    <td align="right">


    <asp:Button id="Button1" onclick="Button_Click" Runat="Server" Text="Submit"></asp:Button>
    </td>
    </tr>
    </tbody>
    </form>
    </table>
    </body>
    </html>
     
  2. change this line...
    Sub Button_Click(S as Object; e As EventArgs)
    to this...
    Sub Button_Click(S as Object, e As EventArgs)


    Joel Thoms
    DiscountASP.NET
    http://www.DiscountASP.NET
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page