asp.net mvc - RenderPartial not working -
i have simple partial view returns (renders) list of synonyms of given word. i'd use partial view inside view , use @html.renderpartial("synonymfinder", new { word = "something" }) inside view. error:
cs1502: best overloaded method match 'system.web.webpages.webpageexecutingbase.write(system.web.webpages.helperresult)' has invalid arguments
this simplest scenario. removed parameters , used @html.renderpartial("synonymfinder"), still same problem. what's wrong?
in mvc 3 should use:
@html.partial("synonymfinder", new viewdatadictionary { { word = "something" } }) note 2nd parameter of type viewdatadictionary. if don't pass explicitly that, helper use overload takes object 2nd parameter , uses model instead of route values.
Comments
Post a Comment