Last post Apr 14, 2008 04:26 AM by Boris2
Apr 04, 2008 07:44 AM|Boris2|LINK
I was wondering how to attach a linq data source to a HtmlHelper select method.
The Method requires an object as datasource. This could be everything really ...
What I expected to use was
Html.Selec("Categories", "name", "id", categoriesDS);
Where name is the Category.name field, id the Category.id field, categoriesDS ths LinqDataSource containing my Category objects.
This gives me an empty select box with no fields whatsoever. In debug mode the categoriesDS has members though.
Apr 06, 2008 07:04 AM|johannes.hiemer|LINK
yes you can use Html.Select with a Linq Datasource. Here you have an example:
<%= Html.Select("userName", ViewData.sUsers, "UserName", "UserId") %>
I hope this helps.
Apr 07, 2008 02:45 AM|Boris2|LINK
Apr 11, 2008 04:43 PM|johannes.hiemer|LINK
did it help? Does it work now? If you got more research and question about htmlhelpers I would recommend to check this site:
Apr 14, 2008 04:26 AM|Boris2|LINK