Giter Site home page Giter Site logo

Comments (3)

erichexter avatar erichexter commented on July 19, 2024

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.

erichexter avatar erichexter commented on July 19, 2024

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.

roryprimrose avatar roryprimrose commented on July 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.