Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Aren't these overloads ambiguous?

Tags:

c#

asp.net-mvc

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?

like image 990
Old Geezer Avatar asked Jul 21 '26 17:07

Old Geezer


1 Answers

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.

like image 162
gretro Avatar answered Jul 24 '26 06:07

gretro



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!