fluent interface for building web controls in c#
C# Batchfile
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
settings
src
tools/NUnit
.gitignore
Build.bat
InstallGems.bat
License.txt
Provenance.txt
README.md
RakeFile
Ruby_Not_Installed.txt
go.bat

README.md

FluentWebControls ReadMe

Description

FluentWebControls is s a fluent interface for emitting web controls in C#.

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) %>

Input Builders

See how we use these controls with our input builders

How To Build:

The build script requires Ruby with rake installed.

  1. Run InstallGems.bat to get the ruby dependencies (only needs to be run once per computer)
  2. open a command prompt to the root folder and type rake to execute rakefile.rb

If you do not have ruby:

  1. You need to create a src\CommonAssemblyInfo.cs file. Go.bat will copy src\CommonAssemblyInfo.cs.default to src\CommonAssemblyInfo.cs
  2. open src\FluentWebControls.sln with Visual Studio and build the solution

License

MIT License

This project is part of MVBA's Open Source Projects.