asp.net button does not work

N

nicholas

Weird thing:

Got an aspx page with a button and an associated code in VB.net.
On my testing server the page works fine.
On the old hosters server the page worked fine too.
But now, at the new hoster it does not.

When I click on the submit button: nothing happens.
The only thing that works is form validation.

I pasted the code below.
It's a login page, but I added this in the code to be sure that the problem
is on this page:
response.write("ok1")
So even this ok1 does not appear.
In fact, when I click on the button, the page is not posted.

Could it be a setting at the hosters server. The hoster says asp.net
scripting is active for the whole site.
PS: other aspx pages on the same website with buttons etc do work at that
hoster.
I really don't get it.

THX for help !

####################### CODE START #######################

<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1"
%>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls"
Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,c
ulture=neutral" %>
<MM:DataSet
id="dsusers"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING
_connusers") %>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABA
SETYPE_connusers") %>'
CommandText='<%# "SELECT * FROM tbl_users WHERE user_name = ? AND
user_password = ?" %>'
Debug="true"
<Parameters>
<Parameter Name="@user_name" Value='<%# IIf((Request.Form("user_name")
<> Nothing), Request.Form("user_name"), "") %>' Type="WChar" />
<Parameter Name="@user_password" Value='<%#
IIf((Request.Form("user_password") <> Nothing),
Request.Form("user_password"), "") %>' Type="WChar" />
</Parameters></MM:DataSet>
<MM:pageBind runat="server" PostBackBind="true" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>LOGIN</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="backoffice.css" rel="stylesheet" type="text/css">
</head>
<body>
<p>&nbsp;</p>
<p>&nbsp;</p>
<form method="POST" enctype="application/x-www-form-urlencoded" id="form1"
runat="server">
<table width="379" height="379" border="0" align="center"
background="images/selfmanager.jpg" class="tblresults">
<tbody>
<tr>
<td height="190" valign="bottom"><div align="center"><strong>
</strong></div></td>
</tr>
<tr>
<td><div align="center" class="style1">
</div></td>
</tr>
<tr>
<td><div align="center"></div></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><div align="center" class="style3"><span
class="style1"><span class="style2">
<asp:Label ID="txt_failed" runat="server" />
</span></span>Gebruikersnaam:</div></td>
</tr>
<tr>
<td>
<div align="center">
<asp:TextBox id="user_name" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1"
EnableClientScript="true" Display="Dynamic" ErrorMessage="Verplicht"
ControlToValidate="user_name" runat="server"></asp:RequiredFieldValidator>
</div></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><div align="center"
class="style3">Wachtwoord:</div></td>
</tr>
<tr>
<td>
<div align="center">
<asp:TextBox ID="user_password" runat="server" TextMode="Password"
/>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2"
EnableClientScript="true" Display="Dynamic" ErrorMessage="Verplicht"
ControlToValidate="user_password"
runat="server"></asp:RequiredFieldValidator>
</div></td>
</tr>
<tr>
<td><div align="center"></div></td>
</tr>
<tr>
<td>
<div align="center">
<asp:Button ID="submit" OnClick="onlogin" runat="server"
Text="LOG-IN"></asp:Button>
</div></td>
</tr>
<tr>
<td>
<div align="center">
<script runat="server">
sub onlogin (sender As Object, e As System.EventArgs)
response.write("ok1")
if dsusers.recordcount > 0 then
Formsauthentication.redirectfromloginpage("backoffice", true)
response.redirect("/backoffice/accesslevel1/index.aspx")
else if ((request.form("user_password")))<> nothing OR
((request.form("user_name"))) <> nothing
txt_failed.text="Login MISLUKT. Probeer opnieuw."
end if
end sub
</script>

</div></td>
</tr>
</tbody>
</table>

</form>
</body>
</html>
####################### CODE END #######################
 
T

Tampa.NET Koder

Copy the aspnet_client folder (I think thats the name) from the root
directory of your web server ( c:\Inetpub\wwwroot\aspnet_client) to the root
directory of your webfolder on the server. That should get this working.
This is a bug in the .net 1.1. See article below. Your hosting admins
would need to follow whats is the document to prevent this.
http://support.microsoft.com/?kbid=889877
 
T

Tampa.NET Koder

Just to be clear. You should copy that folder from your machine (testing)
to your hosting enviornment. This is the work-a-round. Then leave it up to
your hosting provider make the correct fix as posted by MSFT.
 
N

nicholas

Yep
They did the fix and it works now.
So didn't have to do the work-around.

THX a lot !
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top