?
Solved

Form Works Locally, but no on server???

Posted on 2005-04-14
8
Medium Priority
?
172 Views
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


=========CODE==========

    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=????????;" & _
                                    "Password=???????"
        connect.Open()

        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)

        Try
            command1.ExecuteNonQuery()
        Catch ae As SqlException
        Finally
            command1.Dispose()
            connect.Close()
            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)
        Response.Cookies.Add(aCookie)  

    End Sub
End Class

==========================================

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

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
   
  <system.web>

    <!--  DYNAMIC DEBUG COMPILATION
          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" />

    <!--  CUSTOM ERROR MESSAGES
          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" />

    <!--  AUTHENTICATION
          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" />


    <!--  AUTHORIZATION
          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.
    -->
    <authorization>
        <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]"/>
            -->
    </authorization>

    <!--  APPLICATION-LEVEL TRACE LOGGING
          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
          root.
    -->
    <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />


    <!--  SESSION STATE SETTINGS
          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".
    -->
    <sessionState
            mode="InProc"
            stateConnectionString="tcpip=127.0.0.1:42424"
            sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
            cookieless="false"
            timeout="20"
    />

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

</configuration>
0
Comment
Question by:chrisryhal
  • 5
  • 3
8 Comments
 
LVL 18

Expert Comment

by:tusharashah
ID: 13787714
Make sure you are uploading following files:

YourPage.aspx
web.config
<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.

-tushar
0
 
LVL 2

Author Comment

by:chrisryhal
ID: 13787736
When I "Copy Project To Web" I tell it to copy ALL files.  The BIN is included.

Looking at other things now
0
 
LVL 2

Author Comment

by:chrisryhal
ID: 13787759
I don't have access to their IIS.  I use MaximumASP for my host.  Is there not a way in the WebConfig?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 2

Author Comment

by:chrisryhal
ID: 13787766
Same Framework, and everything was uploaded like you specified
0
 
LVL 18

Accepted Solution

by:
tusharashah earned 2000 total points
ID: 13787791
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
0
 
LVL 2

Author Comment

by:chrisryhal
ID: 13787814
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.
0
 
LVL 18

Expert Comment

by:tusharashah
ID: 13790210
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..
0
 
LVL 2

Author Comment

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

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/ASP_DOT_NET/Q_21388134.html

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,
CR
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

839 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