My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members

The development of this project has moved to GitHub

This fluent interface is based the one we saw demonstrated at an Alt.Net conference talk called Opinionated MVC given by Chad Myers and Jeremy Miller. We liked the concept so much that we built a stand alone implementation for our own web application.

This is part of MVBA Law Commons.

sample usages:

TextBox

<%= Fluent.TextBoxFor(() => ViewData.Model.FirstName)
    .WithLabel("First Name:")
    .Width("200px") %>

TextArea

<%= Fluent.TextAreaFor(() => ViewData.Model.Comment)
    .WithLabel("Comments:")
    .Rows(5)
    .Width("400px") %>

Button

<%= Fluent.ButtonFor(ButtonData.ButtonType.New, this)
    .WithText("Add New " + ViewData.Model.BusinessObjectDescription)
    .VisibleIf(ViewData.Model.UserIsAdmin) %>

CheckBox

<%= Fluent.CheckBoxFor(() => ViewData.Model.Active)
    .WithLabel("Active")
    .IsChecked(ViewData.Model.IsActive) %>

DropDownList

<%= Fluent.DropDownListFor(Code.BoundPropertyNames.Type, ViewData.Model.DistinctCodeTypes, n => n.Name1, n => n.Name1)
    .WithDefault("Select", "")		    
    .WithSelectedValue(() => ViewData.Model.Type)
    .WithLabel("Code type:") %>

ComboSelect

<%= Fluent.ComboSelectFor(County.BoundPropertyNames.CourtIds, ViewData.Model.Courts, n => n.DisplayName, n => n.Id)
    .WithSelectedValues(ViewData.Model.SelectedCourts, court => court.CourtId)
    .WithLabel("Courts:") %>

Link

<%= Fluent.LinkTo(ControllerName, ActionName)
    .WithLinkText(">>")
    .WithMouseOverText("Last Page")
    .CssClass("linkHighlight")
    .DisabledIf(PagedListParameters.PageNumber == LastPage)
    .WithData(() => PagedListParameters.PageSize) %>

Hidden input

<%= Fluent.HiddenFor(() => PagedListParameters.PageSize) %>

See how we use these controls in our projects

Powered by Google Project Hosting