fluenthtml

Create select list with first option text with mvccontrib?

Trying to create a select list with a first option text set to an empty string. As a data source I have a List of a GenericKeyValue class with properties "Key" & "Value". My current code is as follows. <%= this.Select(x => x.State).Options(ViewData[Constants.StateCountry.STATES] as IList<GenericKeyValue>, "Value", "K...

Using MVC Contrib FluentHtml in Views

If I understand things correctly, to use MVC Contrib's FluentHtml in my Views, I need to change my Views to inherit from MvcContrib.FluentHtml.ModelViewPage instead of System.Web.Mvc.ViewPage. Will I lose any functionality provided by System.Web.Mvc.ViewPage if I do that? ...

How to set Foreign Key object using Entity Framework and FluentHtml

What I'm looking to do is set a Foreign Key object in an EF entity via FluentHtml. I have an entity of Foo with a reference to the object Bar via Foo.Bar. What I am trying to do is set the value of Bar in my view form. My models contains a collection of all Bars via Model.Bars. In my view I'm simply using <%= this.Select(m => m.Foo.Bar)....

Cannot use fluent html lambda expressions in Spark view

I'm attempting to use fluent html and the spark view engine in my asp.net mvc application. I've assinged the proper base class, added the assemblies, and when i do this.TextBox("MyProperty") it works fine. However I get the below exception when i attempt to use this.TextBox(m=>m.MyProperty). Any idea what can be causing this? Exception...

Problem creating a custom input element using FluentHtml (MVCContrib)

Hi there, I just recently started dabbling in ASP.NET MVC 1.0 and came across the wonderful MVCContrib. I had originally gone down the path of creating some extended html helpers, but after finding FluentHTML decided to try my hand at creating a custom input element. Basically I am wanting to ultimately create several custom input elemen...

How to set the "float" style using FluentHtml in MVCContrib

I'm working in ASP.NET MVC 1.0 using MvcContrib FluentHtml version 1.0. The following code doesn't work because float is a C# keyword. <%= this.TextBox(m => m.Name).Styles(float => "left") %> How do I define the "float" css style using the Styles method in FluentHtml? ...

Disable a checkbox in a MVcContrib.FluentHtml.CheckboxList

Hi, I have just started to discover FluentHml and I'm stuck with the CheckBoxList Helper. Here is the code <ul> <%=this.CheckBoxList(m=>m.Filter) .Options(criteria.Choices, x => x.Code, x => x.DisplayText) .Selected(Model.Filter) .Label(criteria.Label).ItemFormat("<li> {0} </li>") ...