unable to display the validation messages from @Html.ValidationSummary() in MVC view

tyrem

New Member
I have a fairly simple form created in a partial view and loading the form on a jquery dialog. The view is tightly bound to a model. When the user clicks on the submit button with out entering any inputs, I need to show the validation messages.\[code\]<div> <form method="post" enctype="multipart/form-data" id="ssimForm" action="Home/ProcessUploadedFile" onsubmit="return false;"> <div> <h3> Select the file to be uploaded :</h3> <span> <input type="file" name="UploadFileName" id="UploadFileName" /></span> </div> <div> <h3> Select the date range :</h3> <span class="uslabel">From Date(MM/dd/yyyy): </span> <input class="usdate" id="usfromdate" name="StartDate" type="date" /> <span class="uslabel">To Date(MM/dd/yyyy): </span> <input class="usdate" id="ustodate" name="EndDate" type="date" /> </div> <div> <br /> <input type="submit" id="submitButton" name="submitButton" value="http://stackoverflow.com/questions/15891058/Process File" /> </div> @Html.ValidationSummary() <div class="message-success"> <span>@ViewBag.Confirmation</span> </div> <div class="message-error"> <span>@ViewBag.Error</span> </div> </form> </div>\[/code\]Now comes the actual problem. when I submit the form I am able to see the validationSummary object populated with the messages, but they are not getting rendered on the screen. I am able to see the messages if I replace the content of the dialog with the response from the jquery ajax call, that fetches the entire view from the server side. I do not want to take this approach as I beleive this is not the correct way to return validation summary in MVC.Am I missing something? Any help is appreciated.
 
Back
Top