6
Vote

LabelFor Overload Collision

description

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

comments

AimOrchard wrote Dec 3, 2012 at 10: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 8:17 PM

Directed here from https://orchard.codeplex.com/discussions/263172

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.