Click here to Skip to main content
15,891,633 members
Please Sign up or sign in to vote.
3.40/5 (2 votes)
I am using MVC 4 Client Side Validation. HTML code is fine. "data-val-required" is included in form but in validation summery message is not shown.

1-My View

C#
<section id="addNewProject" class="modals">
@using (Html.BeginForm())
{ 
	<section class="modal-content">
                   
	@Html.AntiForgeryToken()
	
	   @Html.LabelFor(model => model.userName, ResourceUsers.resUserNameLbl)
	   @Html.TextBoxFor(model => model.userName, new { id = "txtUserName"})
       				
	   @Html.LabelFor(model => model.firstName, ResourceUsers.resFirstNameLbl)
	   @Html.TextBoxFor(model => model.firstName, new { id = "txtFirstName"})
                        
	   @Html.LabelFor(model => model.lastName, ResourceUsers.resLastNameLbl)
	   @Html.TextBoxFor(model => model.lastName, new { id = "txtLastName" })
                        
	   @Html.LabelFor(model => model.userEmail, ResourceUsers.resEmailIdLbl)
	   @Html.TextBoxFor(model => model.userEmail, new { @class = "emailonly" })
               
	</section>
	@Html.ValidationSummary()
	<section class="modal-footer">
		<ul class="clearfix buttons-inline">
		     <li><input type="submit" /></li>
	        </ul>
	</section>
} 
</section>


2- jquery bundle

VB
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                       "~/Scripts/jquery.unobtrusive*",
                       "~/Scripts/jquery.validate*"));
Posted
Comments
Sunasara Imdadhusen 26-Dec-13 6:55am    
Have you tried to see Validation Summary using Firebug, it might be inside the your dialog box.
Vi(ky 27-Dec-13 6:08am    
yes i tried but there is no message append in validation summary.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900