我对验证空文本框问题校验空值
我的文本框
<asp:TextBox ID="TextBox1" runat="server" MaxLength="50" Width="272px" AutoCompleteType="Disabled">
我的标签
<asp:Label ID="warning" runat="server" Text="you forgot about this" ForeColor="Red" Visible="false"></asp:Label>
我的验证
if (TextBox1.Text == "")
{
warning.Visible = true;
}
它可以验证空的文本框,但它不能验证空间输入
有人可以帮我吗?
为什么你没有使用ASP.NET验证控件? – 2014-10-29 12:32:15