This project is read-only.

LabelFor Overload Collision


I know this is minor, however I just ran into a collision between one of the default MVC LabelFor helpers and an Orchard helper. Basically, this method:
public static IHtmlString LabelFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression, string labelText)
conflicts with one of the default overloads in mvc. The simple workaround, and the way it probably should be used is to use the localized overload. The only reference to the non-localized method is in the same class, so I think it would be safe to mark it as private. I'm attaching a patch which does that.

file attachments


AimOrchard wrote Dec 3, 2012 at 11:17 AM

Could this please be included?

I ran into this issue today and I wouldn't have lost time figuring it out if this 1year+ old ticket would have been processed...

strivinglife wrote May 30, 2013 at 9:17 PM

Directed here from

Is this still planned for 2.0? We're moving over an existing site built in ASP.NET MVC and ran into this issue. Applying the patch worked perfectly for us, but it's one more thing to remember when it's time to upgrade.

AJ_Shoothill wrote Jan 15, 2015 at 3:36 PM

Has this still not been fixed?

I'm getting the same issue (as far as I can tell) and I'm using the same crappy fix as specified here:

Evidently 2.0 isn't going to drop soon so can we have this fixed?

There's even a patch file supplied! Why hasn't this ticket been updated with the status of this issue and why the patch wasn't accepted/applied?