html helper takes a dictionary<string,object>, how to use this parameter?

Blankman picture Blankman · Jul 15, 2010 · Viewed 11k times · Source

If a html helper takes a idictionary as a parameter, how do I use it?

I tried:

<%= Html.Blah( new { id = "blah" }) %>

But that doesn't work.

Answer

Justin Niessner picture Justin Niessner · Jul 15, 2010
<%= Html.Blah( new Dictionary<string, object>(){
                                                   { "key", "value" },
                                                   { "key1", someObj },
                                                   { "blah", 1 }
                                               } );