This project is read-only.

using GUID

Feb 10, 2012 at 1:41 PM

It seems like the controls are not working for entities that have GUID as the Id?

Feb 10, 2012 at 2:59 PM

Which Control? And What do you mean with "not working" ?

Feb 12, 2012 at 10:49 AM

So sorry, I really should have been very specific in my post. I wanted to use the checkboxlist and when I tried it out in my application there's a design-time error:

The type arguments for method 'MVCControlsToolkit.Controls.CheckBoxListHelper.CheckBoxListFor<TModel,TChoiceItem,TValue,TDisplay>(System.Web.Mvc.HtmlHelper<TModel>, System.Linq.Expressions.Expression<System.Func<TModel,System.Collections.Generic.IEnumerable<TValue>>>, MVCControlsToolkit.Core.ChoiceList<TChoiceItem,TValue,TDisplay>, bool, object, object)' cannot be inferred from the usage. Try specifying the type arguments explicitly.    c:\temp\mvc control toolkit\BinariesWithSimpleExamples\MVC3NestedModels\Views\Account\Register.aspx

Now that error is actually from the sample application I got here from codeplex. That is the similar error I got from my application. I tried changing the sample to see if my issue won't happen with the sample code. And the issue is that I am using a GUID as Id. In the sample code I changed:

public List<int> Roles1 { get; set; }


public List<Guid> Roles1 { get; set; }

Feb 12, 2012 at 3:37 PM
Edited Feb 12, 2012 at 4:36 PM

At moment, both CheckBoxList and DualSelect accepts just IConvertibles as their value, that is basic Net types. All other controls works properly with any type. This is because just types that can be converted from/to strings can be put into an Html form. The Guid is NOT a basic type but has a TypeCoverter to create it from a string value, so it might be handled too.

I modified the above helpers to use a type converter when available. If you send me you emai through my contact form (don't put it here...because of spam), I will send you the updated dll (pls say me if you are using Mvc3 or Mvc2). If you confirm they solve your problem I will put the new dll on NuGet.

Contact form is here: