Works on Local machine but not on web hosting server, any ideas why?


VB Code:
  1. <%@ Page Language="VB" Trace="false" %>
  2. <%@ import Namespace="System.Data.SqlClient" %>
  3. <script runat="server">
  4.    
  5.     Sub Page_Load
  6.     Dim actionstr as String
  7.    
  8.             If User.Identity.ISAuthenticated = "false" then
  9.                 If not Request.QueryString("action") = "login" then
  10.                 Response.Redirect("Corefile.aspx?action=login")
  11.                 end if
  12.             end if
  13.    
  14.     Trace.Write( "User.Identity.ISAuthenticated = " & User.Identity.ISAuthenticated )
  15.    
  16.     End Sub
  17.    
  18.  
  19.  
  20.     Sub Button2_Click(sender As Object, e As EventArgs)
  21.  
  22.     FormsAuthentication.SignOut
  23.     Response.Redirect("Corefile.aspx?action=login")
  24.  
  25.     End Sub
  26.  
  27.    
  28.  
  29.     Function Authenticated(username As String, password As String) As Boolean
  30.             Dim dbconnection As Sqlconnection
  31.             Dim getuserID as Sqlcommand
  32.             Dim userID as SqlDataReader
  33.    
  34.                 dbconnection = New SqlConnection( "Server=888;uid=commline;pwd=88;database=88" )
  35.                 dbconnection.open()
  36.    
  37.                     getuserID = New sqlcommand( "Select u_id FROM Userfile WHERE u_username = '" & Microsoft.Visualbasic.Lcase(txtuser.text) & "' AND u_password = '" & Microsoft.Visualbasic.Lcase(txtpass.text) & "'", dbconnection )
  38.                     userID = getuserID.ExecuteReader()
  39.    
  40.                     If userID.HasRows then
  41.    
  42.                     While userID.Read()
  43.    
  44.             Return True
  45.    
  46.                     End While
  47.    
  48.                     Else
  49.    
  50.                     Return False
  51.    
  52.                     End if
  53.    
  54.                 userID.close()
  55.                 dbconnection.close()
  56.    
  57.     End Function
  58.  
  59.  
  60.  
  61.     Sub Button1_Click(sender As Object, e As EventArgs)
  62.     If Authenticated(txtuser.text,txtpass.text) then
  63.    
  64.     Dim ticket as New FormsAuthenticationTicket( txtuser.text, checkbox1.checked, 10 )
  65.     Dim encTicket As String = FormsAuthentication.Encrypt(ticket)
  66.     Response.Cookies.Add(New HttpCookie(FormsAuthentication.FormsCookieName,encticket))
  67.     Response.Redirect("Corefile.aspx?action=summary")
  68.     else
  69.    
  70.     Label1.text = "Bad username or Password"
  71.    
  72.     end if
  73.     End Sub
  74.  
  75. </script>
  76. <% Select Case Request.QueryString("action") %><% Case "login" %>
  77. <html>
  78. <head>
  79. </head>
  80. <body>
  81.     <form runat="server">
  82.         <p>
  83.             <font face="Trebuchet MS" size="5"><strong>CLIENT LOGIN</strong></font>
  84.         </p>
  85.         <p>
  86.             <font size="2"><font face="Trebuchet MS">Username:</font>
  87.             <br />
  88.             </font>
  89.             <asp:TextBox id="txtuser" runat="server"></asp:TextBox>
  90.         </p>
  91.         <p>
  92.             <font face="Trebuchet MS" size="2">Password:</font>
  93.             <br />
  94.             <asp:TextBox id="txtpass" runat="server"></asp:TextBox>
  95.         </p>
  96.         <p>
  97.             <asp:CheckBox id="CheckBox1" runat="server" Text="Remember me with Cookies?"></asp:CheckBox>
  98.             <br />
  99.             <br />
  100.             <asp:Label id="Label1" runat="server" font-bold="True" forecolor="Red" font-size="X-Small" font-names="Trebuchet MS" width="227px">Welcome
  101.             to Client Login</asp:Label>
  102.         </p>
  103.         <p>
  104.             <asp:Button id="Button1" onclick="Button1_Click" runat="server" Text="Login" Width="72px"></asp:Button>
  105.         </p>
  106.         <!-- Insert content here -->
  107.     </form>
  108.     <p>
  109.         <% Case "summary" %>
  110.  
  111.     User.Identity.IsAuthenticated = <% Response.write ( User.Identity.ISAuthenticated ) %> <p>
  112.  <form runat="server">
  113. <asp:Button id="Button2" onclick="Button2_Click" runat="server" Text="Log Out" Width="72px"></asp:Button>
  114.  </form>
  115.  
  116.     <% Case Else %>
  117.  
  118.     What do you want?
  119.  
  120.     <% End Select %>
  121.     </p>
  122. </body>
  123. </html>

VB Code:
  1. <configuration>
  2.   <system.web>
  3. <customErrors mode="Off"/>
  4.     <appSettings>
  5.  <authentication mode="Forms">
  6.       <forms
  7.         name=".ASPXAUTH"
  8.         loginUrl="corefile.aspx?action=login"
  9.         protection="All"
  10.         timeout="80"
  11.         path="/"/>
  12.       </authentication>
  13. <authorization>
  14. <deny users="?" />
  15. </authorization>
  16.     </system.web>
  17. </configuration>