We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am using @Html.ValidationSummary(true) but it is rendering in its default div/ul/li styling.
I don't have any integration with LESS yet, so the solution at http://stackoverflow.com/questions/13867307/show-validationsummary-mvc33-as-alert-error-bootstrap is a good option for me ATM.
I have added a partial view as indicated in the SO link.
@if (ViewData.ModelState[""] != null && ViewData.ModelState[""].Errors.Any()) { <div class="alert alert-error"> <a class="close" data-dismiss="alert">×</a> @Html.ValidationSummary(true) </div> }
I then added this partial view in the bootstrap layout file under the reference to
@Html.Partial("_alerts") @Html.Partial("ValidationSummary")
The only thing missing is the styling of the UL which I removed with the following css:
.validation-summary-errors ul { list-style-type: none; }
It would be nice if this made it into the package. Not sure how you would want to integrated it though.
Cheers,
Rory
The text was updated successfully, but these errors were encountered:
That makes a lot of sense... I need to try this out with the runtime scaffolding.
Eric Hexter
blog | http://Hex.LosTechies.com info | http://www.linkedin.com/in/erichexter
On Sat, Dec 29, 2012 at 5:05 AM, roryprimrose notifications@github.comwrote:
I am using @Html.ValidationSummary(true) but it is rendering in its default div/ul/li styling. I don't have any integration with LESS yet, so the solution at http://stackoverflow.com/questions/13867307/show-validationsummary-mvc33-as-alert-error-bootstrapis a good option for me ATM. I have added a partial view as indicated in the SO link. @if (ViewData.ModelState[""] != null && ViewData.ModelState[""].Errors.Any()) { × @Html.ValidationSummary(true) } I then added this partial view in the bootstrap layout file under the reference to @Html.Partial("_alerts") @Html.Partial("ValidationSummary") The only thing missing is the styling of the UL which I removed with the following css: .validation-summary-errors ul{ list-style-type: none;} It would be nice if this made it into the package. Not sure how you would want to integrated it though. Cheers, Rory — Reply to this email directly or view it on GitHubhttps://github.com//issues/45.
I don't have any integration with LESS yet, so the solution at http://stackoverflow.com/questions/13867307/show-validationsummary-mvc33-as-alert-error-bootstrapis a good option for me ATM.
@if (ViewData.ModelState[""] != null && ViewData.ModelState[""].Errors.Any()) {
.validation-summary-errors ul{ list-style-type: none;}
— Reply to this email directly or view it on GitHubhttps://github.com//issues/45.
Sorry, something went wrong.
I started implementing this.. it will need an additional css file to be included in the package, to handle the override of the mvc default style.
Fixed bug in the partial view which wouldn't render errors related to properties (via the true parameter on ValidationSummary)
I now use:
@if (ViewData.ModelState.Any(x => x.Value.Errors.Any()))
No branches or pull requests
I am using @Html.ValidationSummary(true) but it is rendering in its default div/ul/li styling.
I don't have any integration with LESS yet, so the solution at http://stackoverflow.com/questions/13867307/show-validationsummary-mvc33-as-alert-error-bootstrap is a good option for me ATM.
I have added a partial view as indicated in the SO link.
I then added this partial view in the bootstrap layout file under the reference to
The only thing missing is the styling of the UL which I removed with the following css:
It would be nice if this made it into the package. Not sure how you would want to integrated it though.
Cheers,
Rory
The text was updated successfully, but these errors were encountered: