u936293
u936293

Reputation: 16264

Aren't these overloads ambiguous?

Source

ActionLink(HtmlHelper, String, String, Object) 
ActionLink(HtmlHelper, String, String, String) 

Isn't string an Object? How do I call the first overload with a string as the third parameter?

Upvotes: 3

Views: 36

Answers (1)

gretro
gretro

Reputation: 2009

You will need to cast your string into object (object)"my string".

I know this is really ugly, but this is the only way. And I agree with you that many method overloads from the HtmlHelper are really ambiguous.

Upvotes: 2

Related Questions