I’m trying to do some validation in asp .net MVC 2.0 for my application. I want to have some nice client side validation. Validation should be done most time on model side with DataAnnotations with custom attributes( like CompareTo, StringLenght, MinPasswordLenght (from Membership.MinimumumpassworkdLenght value). For that purpose I tried to use xval with jquery.validation. Some specific thing is that most of forms will be working with ajax and most problems are when I want to validate form with ajax.
http://www.sendspace.com/file/m9gl54“rel=“nofollow noreferer” http://www.sendspace.com/file/m9gl54。 。
我采取两种控制形式。 ValidFormControl1.ascx, ValidFormControl2.ascx
<% using (Ajax.BeginForm("CreateValidForm", "Test", new AjaxOptions { HttpMethod = "Post" })) {%> <div id="validationSummary1">
<%= Html.ValidationSummary(true)%> </div> <fieldset>
<legend>Fields</legend>
<div class="editor-label">
<%= Html.LabelFor(model => model.Name)%>
</div>
<div class="editor-field">
<%= Html.TextBoxFor(model => model.Name)%>
<%= Html.ValidationMessageFor(model => model.Name)%>
</div>
<div class="editor-label">
<%= Html.LabelFor(model => model.Email)%>
</div>
<div class="editor-field">
<%= Html.TextBoxFor(model => model.Email)%>
<%= Html.ValidationMessageFor(model => model.Email)%>
</div>
<div class="editor-label">
<%= Html.LabelFor(model => model.Password)%>
</div>
<div class="editor-field">
<%= Html.TextBoxFor(model => model.Password)%>
<%= Html.ValidationMessageFor(model => model.Password)%>
</div>
<div class="editor-label">
<%= Html.LabelFor(model => model.ConfirmPassword)%>
</div>
<div class="editor-field">
<%= Html.TextBoxFor(model => model.ConfirmPassword)%>
<%= Html.ValidationMessageFor(model => model.ConfirmPassword)%>
</div>
<p>
<input type="submit" value="Create" />
</p> </fieldset> <% } %> <%= Html.ClientSideValidation<ValidModel>()
.UseValidationSummary("validationSummary1", "Please fix the following problems:") %>
两种情况相同,只是验证摘要(效力验证摘要1,验证摘要2)。 两种控制均在一页上:
Form2
<%Html.RenderPartial("~/Views/Test/ValidFormControl2.ascx", null); %>
Form1
<%Html.RenderPartial("~/Views/Test/ValidFormControl.ascx", null); %>
<>地平>
First problem, when we have two controls with same type to validate it don’t work becosue html elements are rendered by field name ( so we have two element with same name “Password” ). Only first form will be validated by client side. The worst thing is that even if we have different types and their fields name is same validation won’t work too ( this thing is what I need to repair it will be stupid to name some unique properites for validation ).
www.un.org/Depts/DGACM/index_spanish.htm 是否有解决办法?
<><>><><>Custom Substances accreditation>>
接下来的习俗属实验证(所有这些错误都是在我使用Ajax进行正常形式的验证工作时没有问题):
比较 简而言之,在记账模型的湿度模板中做了比较(对两个财产的分类称呼将作一比较),该数字在页上没有显示。 为了做到这一点,我设立了自己的《规则》提供人,比较《规则》和我的《标准》。 或许更容易做到这一点?
我拿着最低和最高值的强力,没有描述我是如何做的,但是否很容易去做?
http://www.ohchr.org。
当我对网页上的所有摘要验证信息有两种控制时,甚至Xval生成的文字都说,内容识别对摘要而言是不同的。 谁知道如何修补?
http://www.ohchr.org。
在Html的地方,是否可选择转电。 婚姻 For (model => model.ConfirmPasword). 对我来说,它没有显示。 我想有摘要和近距离实地信息,不仅是红边界。 任何人都知道如何这样做?
<>Ajax>
Anyone know how to do easy without massive code in javascript to do submit via javascript. This will be used to change input submit to href element (a). Both look same the difference is only validation summaryID