Visual Studio Feeds English |
- My experience at MVP Open Day India - Day 2
- Unity (ubuntu desktop) is good
- Z-Index in Silverlight / WPF
- Web Camp Anchor HTML5 & CSS3 Resources
- SQL Server Management Studio Alternatives that are Free
- Pictures from Microsoft Tech·Ed 2011 - DevExpress Awards and Fun! #msteched
- MVC CheckBoxListFor Helper Extension
- Model Binding Checkboxes in MVC
- Roadmaps and promises
- The Los Angeles Silverlight Usergroup (LASLUG) Mentioned in the Weekly MVP Newsletter
| My experience at MVP Open Day India - Day 2 Posted: 20 May 2011 02:54 PM PDT |
| Unity (ubuntu desktop) is good Posted: 20 May 2011 01:39 PM PDT |
| Posted: 20 May 2011 11:36 AM PDT |
| Web Camp Anchor HTML5 & CSS3 Resources Posted: 20 May 2011 10:51 AM PDT |
| SQL Server Management Studio Alternatives that are Free Posted: 20 May 2011 10:20 AM PDT |
| Pictures from Microsoft Tech·Ed 2011 - DevExpress Awards and Fun! #msteched Posted: 20 May 2011 10:05 AM PDT |
| MVC CheckBoxListFor Helper Extension Posted: 20 May 2011 10:05 AM PDT This has been done a few times, here's my attempt: public static MvcHtmlString CheckBoxListFor(this HtmlHelper htmlHelper, Expression expression) where TValue : IEnumerable { var name = expression.Body is ParameterExpression ? ((ParameterExpression)expression.Body).Name : ((MemberExpression)expression.Body).Member.Name; var sb = new StringBuilder(); var values = ((IEnumerable)expression.Compile().Invoke(htmlHelper.ViewData.Model)).Select(x => x.ToString()); foreach (var value in values) { sb.Append(string.Format("{0} ", value, name, value)); } return new MvcHtmlString(sb.ToString()); } I included a ParameterExpression just in case the model is an IEnumerable so if your |
| Model Binding Checkboxes in MVC Posted: 20 May 2011 10:05 AM PDT Just so I don't forget, again, it's as simple as this: Controller: public class HomeController : Controller { public ActionResult Index() { return View(new []{"one", "two", "three"}); } [HttpPost] public ActionResult Index(IEnumerable items) { return View("Result", items); } } View: @model IEnumerable @using (Html.BeginForm()) { foreach (var item in Model) { @item } } ...(Read whole news on source site) (http://geekswithblogs.net/Nettuce/archive/2011/05/20/model-binding-checkboxes-in-mvc.aspx) |
| Posted: 20 May 2011 10:05 AM PDT |
| The Los Angeles Silverlight Usergroup (LASLUG) Mentioned in the Weekly MVP Newsletter Posted: 20 May 2011 09:50 AM PDT |
| You are subscribed to email updates from VSF RSS English To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
| Google Inc., 20 West Kinzie, Chicago IL USA 60610 | |
Комментариев нет:
Отправить комментарий