Skip to content

Fluent, jQuery-style chainable Html Helpers for Microsoft ASP .Net MVC

Notifications You must be signed in to change notification settings

kouweizhong/Build.Mvc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Build.Mvc

Build.Mvc is a helper extensions method library that turns the standard ASP .NET MVC HtmlHelper methods into jQuery-style chainable methods that allow you to expressively add markup and style to your MVC application.

Build.Mvc is available on NuGet

Build.Mvc let's you change this:

@if (Model.DateOfBirth.HasValue)
{ 
    @Html.TextBoxFor(m => m.DateOfBirth, String.Format("{0:d}", Model.DateOfBirth) ,new { @class = "ui-datepicker span11", @style = "display:block;float:left;" })
}
else
{ 
    @Html.TextBoxFor(m => m.DateOfBirth, new { @value = "", @class = "ui-datepicker span11", @style = "display:block;float:left;" ,@readonly="readonly"})
}

Into this:

@Html.BuildTextBoxFor(m => m.DateOfBirth, string.Format("{0:d}", Model.DateOfBirth)).BuildWith(
    b => b.AddClass("ui-datepicker", "span11").
        Css("display", "block").
        Css("float", "left").
        BuildWhen(Model.DateOfBirth == null, t =>
            t.Attr("value", "").
              Attr("readonly", "readonly")
        ))

View the project on CodePlex for more complete documentation.

Reference and Example Apps

  1. SocialGoal is a MVC 5, EF6 Reference App

About

Fluent, jQuery-style chainable Html Helpers for Microsoft ASP .Net MVC

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 99.9%
  • Batchfile 0.1%