Form Works Locally, but no on server???

Posted on 2005-04-14
Last Modified: 2010-04-07
Any idea, why this works locally, as far as the button performing its function, but when I upload to my host, you just keep pushing and pushing the button, and nothing happens.  I included the WebConfig too just in case it may lie in that.

Thanks for the help


    Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
        Dim connect As SqlConnection = New SqlConnection
        connect.ConnectionString = "Data Source=???????;" & _
                                    "Initial Catalog=???????;" & _
                                    "UID=????????;" & _

        Dim strSQLInsert As String

        strSQLInsert = "Insert into Members(FirstName,LastName,Company,Address,City,State,Email,Website,Password,SecurityQuestion,SecurityAnswer,MemberStatus) values ("
        strSQLInsert = strSQLInsert & "'" & Trim(txtFirstName.Text) & "',"
        strSQLInsert = strSQLInsert & "'" & Trim(txtLastName.Text) & "',"
        strSQLInsert = strSQLInsert & "'" & Trim(txtCompany.Text) & "',"
        strSQLInsert = strSQLInsert & "'" & Trim(txtAddress.Text) & "',"
        strSQLInsert = strSQLInsert & "'" & Trim(txtCity.Text) & "',"
        strSQLInsert = strSQLInsert & "'" & Trim(txtState.SelectedValue) & "',"
        strSQLInsert = strSQLInsert & "'" & Trim(txtEmail.Text) & "',"
        strSQLInsert = strSQLInsert & "'" & Trim(txtWebsite.Text) & "',"
        strSQLInsert = strSQLInsert & "'" & Trim(txtPassword.Text) & "',"
        strSQLInsert = strSQLInsert & "'" & Trim(txtSecurityQuestion.Text) & "',"
        strSQLInsert = strSQLInsert & "'" & Trim(txtSecurityAnswer.Text) & "',"
        strSQLInsert = strSQLInsert & "'" & Trim(cmbMemberShip.SelectedValue) & "')"

        Dim command1 As New SqlCommand(strSQLInsert, connect)

        Catch ae As SqlException
            connect = Nothing
        End Try

        Dim aCookie As New HttpCookie("MAPPCOOKIE")
        aCookie.Values("FirstName") = txtFirstName.Text
        aCookie.Values("LastName") = txtLastName.Text
        aCookie.Expires = DateTime.Now.AddDays(3)

    End Sub
End Class


=========WEB CONFIG===========

<?xml version="1.0" encoding="utf-8" ?>

          Set compilation debug="true" to insert debugging symbols (.pdb information)
          into the compiled page. Because this creates a larger file that executes
          more slowly, you should set this value to true only when debugging and to
          false at all other times. For more information, refer to the documentation about
          debugging ASP.NET files.
    <compilation defaultLanguage="vb" debug="true" />

          Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable.
          Add <error> tags for each of the errors you want to handle.

          "On" Always display custom (friendly) messages.
          "Off" Always display detailed ASP.NET error information.
          "RemoteOnly" Display custom (friendly) messages only to users not running
           on the local Web server. This setting is recommended for security purposes, so
           that you do not display application detail information to remote clients.
    <customErrors mode="RemoteOnly" />

          This section sets the authentication policies of the application. Possible modes are "Windows",
          "Forms", "Passport" and "None"

          "None" No authentication is performed.
          "Windows" IIS performs authentication (Basic, Digest, or Integrated Windows) according to
           its settings for the application. Anonymous access must be disabled in IIS.
          "Forms" You provide a custom form (Web page) for users to enter their credentials, and then
           you authenticate them in your application. A user credential token is stored in a cookie.
          "Passport" Authentication is performed via a centralized authentication service provided
           by Microsoft that offers a single logon and core profile services for member sites.
    <authentication mode="Windows" />

          This section sets the authorization policies of the application. You can allow or deny access
          to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous
          (unauthenticated) users.
        <allow users="*" /> <!-- Allow all users -->

            <!--  <allow     users="[comma separated list of users]"
                             roles="[comma separated list of roles]"/>
                  <deny      users="[comma separated list of users]"
                             roles="[comma separated list of roles]"/>

          Application-level tracing enables trace log output for every page within an application.
          Set trace enabled="true" to enable application trace logging.  If pageOutput="true", the
          trace information will be displayed at the bottom of each page.  Otherwise, you can view the
          application trace log by browsing the "trace.axd" page from your web application
    <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />

          By default ASP.NET uses cookies to identify which requests belong to a particular session.
          If cookies are not available, a session can be tracked by adding a session identifier to the URL.
          To disable cookies, set sessionState cookieless="true".
            sqlConnectionString="data source=;Trusted_Connection=yes"

          This section sets the globalization settings of the application.
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" />

Question by:chrisryhal
    LVL 18

    Expert Comment

    Make sure you are uploading following files:

    <bin> directory... [ i think you didnt included this ]

    Now, is your directory on the server is configured as Application? ( you can do this from IIS )

    Also, check out the .Net Framework installed on your Server is the same as the one you have on your local machine.

    LVL 2

    Author Comment

    When I "Copy Project To Web" I tell it to copy ALL files.  The BIN is included.

    Looking at other things now
    LVL 2

    Author Comment

    I don't have access to their IIS.  I use MaximumASP for my host.  Is there not a way in the WebConfig?
    LVL 2

    Author Comment

    Same Framework, and everything was uploaded like you specified
    LVL 18

    Accepted Solution

    Try to copy "C:\Inetpub\wwwroot\aspnet_client" folder on your root directory on the server...

    Also, FYI you dont need to upload .CS file and .ASCX file, as .CS files are compiled in to DLL and ASCX are needed only if you are writing any information in them.

    I believe you are gettting this error because Client Scripts are not mapped correctly, there's nothing in Web.COnfig you can do about it.

    HTH, -tushar
    LVL 2

    Author Comment

    Ok, you are a lifesaver.  The copy worked.  Please explain why I had to do this.  Why is the .NET Framework so weird like this.  I had this problem before with a Windows Application back with VS.NET 2002.
    LVL 18

    Expert Comment

    If you check out the .JS file available inside aspnet_client folder you'll have clear idea why would you need them. Some, host do give them and some keep it up to user..
    LVL 2

    Author Comment

    I see.  Well, thank you again for your help.  Maybe sometime, you could help me on the Cookie question I have at:

    I am pretty proficient with WinApps, but new to ASP.NET.  In fact, I have not really ever had to build websites before, so thought it might be better to stick with something I kinda know, than older ASP.

    Thanks Again,

    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    Suggested Solutions

    One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on could not pull conte…
    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now