I'm stuck with a problem using jQuery Validate. The thing is I have a few textboxes with their maxlength attributes set. Although they are not required, they still fail to validate when either empty or whitespace.
Sample HTML:
<input type="textbox" id="tbx1" maxlength="100" value="" />
Then, $('#tbx1').valid() returns false. Shouldn't it return true instead? Are there any known workarounds for this?
Oh, and adding $('#myform').validate({ ignore: '#tbx1' }); doesn't quite work for me, because I'm using ASP.NET controls with their …
我有以下情况:
using (SqlConnection conexao = new SqlConnection(ConnectionString))
{
SqlCommand comando = new SqlCommand(query, conexao);
comando.Parameters.AddWithValue("id", idUsuario);
conexao.Open();
SqlDataReader reader = comando.ExecuteReader(CommandBehavior.SingleRow);
if (reader.Read())
{
Hydrate(out entity, reader);
}
}
Run Code Online (Sandbox Code Playgroud)
那么,如果reader包含有效结果HasRows == true,那么reader.Read()应该返回true,对吗?
嗯,它不适合我.我不知道发生了什么,因为Hydrate(out entity, reader);线路永远不会被击中.
有人可以帮我理解这个吗?
谢谢!