FormFields for ASP.net <formField:checkBoxList ... >

markup results

Linq-to-SQL (using defaults)

<formField:checkBoxList ID="ffcblCategory" 
  runat="server" Title="Category" 
  L2STableName="category" 
  RepeatDirection="Vertical" />




You can specify a few more properties to get more control of the L2S binding; notice the 'Flow' layout specification

Linq-to-SQL (required)

<checkBoxList ID="ffcblUser" runat="server" 
  Title="User" Required="true" 
  L2STableName="_user" DataTextField="last_name" 
  SelectedValue="3" L2SOrderByColumn="last_name" 
  RepeatLayout="Flow" />

It can still be used with normal DataSources as well; notice the multiple selections

SqlDataSource

<formField:checkBoxList ID="ffcblSDS" 
  runat="server" Title="Category" 
  DataSourceID="sds" 
  SelectedValue="pirate;ninja" />

© 2012 Stan Naspinski