为什么在本地RequiredFieldValidator判断时有效,上传到空间有没用了
为什么在本地RequiredFieldValidator判断时有效,上传到空间有没用了<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="CZHAdmin_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<style type="text/css">
<!--
body {
margin: 0px;
padding: 0px;
font-size: 12px;
}
-->
</style>
</head>
<body style="background:#026aa9;">
<form id="form1" runat="server">
<div style="margin:120px auto 0 auto">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#026aa9">
<tr>
<td>
<table width="912" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<img src="images/ht_01.jpg" width="912" height="76"></td>
</tr>
<tr>
<td align="center" valign="top" background="images/ht_02.jpg" style="height: 205px">
<table border="0" cellpadding="0" cellspacing="0" style="margin: 80px 0 0 15px">
<tr>
<td height="85">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="22" rowspan="2" valign="bottom">
<img src="images/Admin_Login1_0_15.gif" width="20" height="30" /></td>
<td style="width: 115px">
<font color="#ffffff">用户名称:</font></td>
<td width="22" rowspan="2" valign="bottom">
<img src="images/Admin_Login1_0_19.gif" width="20" height="30" /></td>
<td style="width: 115px">
<font color="#ffffff">用户密码:</font></td>
<td rowspan="2" valign="bottom">
</td>
</tr>
<tr>
<td style="width: 115px; height: 24px;">
<asp:TextBox ID="TxtLoginName" runat="server" Width="108px"></asp:TextBox><asp:RequiredFieldValidator
ID="TxtLogin_Name" runat="server" ControlToValidate="TxtLoginName"
ErrorMessage="请正确填写登录名!"></asp:RequiredFieldValidator></td>
<td style="width: 115px; height: 24px;">
<asp:TextBox ID="TxtPwd" runat="server" Width="108px" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator
ID="Txt_Pwd" runat="server" ControlToValidate="TxtPwd"
ErrorMessage="请正确填写密码!"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td width="22" rowspan="2" valign="bottom">
<img src="images/Admin_Login1_admin.gif" width="29" height="30" /></td>
<td style="width: 115px; height: 19px">
<font color="#ffffff">管理认证码:</font></td>
<td width="22" rowspan="2" valign="bottom">
<img src="images/Admin_Login1_0_23.gif" width="29" height="30" /></td>
<td colspan="2" style="height: 19px">
</td>
</tr>
<tr>
<td align="left" style="width: 115px; height: 23px">
<asp:TextBox ID="TxtPwdTw" runat="server" Width="108px" TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator
ID="TxtPwd_Tw" runat="server" ControlToValidate="TxtPwdTw"
ErrorMessage="请正确填写认证码!" ></asp:RequiredFieldValidator></td>
<td style="height: 23px;" colspan="2">
<asp:ImageButton ID="ImgBtnLogin" runat="server" ImageUrl="~/CZHAdmin/images/login1.jpg" OnClick="ImgBtnLogin_Click" />
<asp:ImageButton ID="ImgBtnBack" runat="server" ImageUrl="~/CZHAdmin/images/back1.jpg" OnClick="ImgBtnBack_Click" ValidationGroup="3" />
</td>
</tr>
</table>
</td>
</tr>
</table>
<br />
</td>
</tr>
<tr>
<td style="height: 87px">
<img src="images/ht_03.jpg" width="912" height="87"></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
--------------------编程问答-------------------- 如果你使用了服务器验证控件,那么你必须要把根目录下的aspnet_client也一块放到网站上去! --------------------编程问答-------------------- 即
C:\Inetpub\wwwroot\
下的aspnet_client文件夹也放在根目录下.传上去看看 --------------------编程问答-------------------- 你的还是asp.net1.1程序?
2.0之后不用 aspnet_client文件夹了。
发现2.0使用了一个WebResource.axd的资源映射,于是添加了<httpHandlers>
<add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
</httpHandlers>结果问题还是一样!
是不是服务商那里没有添加对.axd的扩展呢?于是再次联系服务商增加了扩展,问题解决。
可执行文件:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASPnet_isapi.dll
扩展名:.axd
限制为:GET,HEAD,POST,DEBUG
并且去除“确认文件是否存在”的勾。 --------------------编程问答-------------------- 仔细检查服务器配置
补充:.NET技术 , ASP.NET