Comments (3)
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 [email protected]:
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.
from twitter.bootstrap.mvc.
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.
from twitter.bootstrap.mvc.
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()))
from twitter.bootstrap.mvc.
Related Issues (20)
- Error when trying to NUGET install HOT 9
- Bug in NavigationRouteConfigurationExtensions HOT 1
- Model editor does not display Start Date HOT 6
- adding additional attributes to "EditorFor" control HOT 2
- A namespace cannot directly contain members such as fields or methods HOT 7
- Paging issue with active page HOT 6
- End-to-end test: the generated solution does not compile HOT 1
- Support `[Display(Autogenerate=false)]`: decorated properties should not be displayed HOT 1
- htmlAttributes not forwarded
- BeginControlGroupFor doesn't always identify property names from an expression
- Controller alert methods should be extension methods rather than BootstrapBaseController HOT 3
- BootstrapBaseController can't handle multiple alerts HOT 2
- Support for ScaffoldColumn Attribute HOT 2
- Adding Glimpse nuget package breaks navigation extension HOT 6
- Do not use a custom unobrusive validation script HOT 1
- NavigationViewExtensions does not properly add active css class to active nav list item
- Custom text in TwitterBootstrapMVC.Renderers.Renderer.RenderValidationSummary() HOT 1
- Pulls Bootstrap V3 HOT 10
- Update to use twitter.bootstrap 3 HOT 5
- Twitter Bootstrap for ASP.Net MVC 4 Sample 1.1.100 Crash HOT 35
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twitter.bootstrap.mvc.