In using HtmlHelper.ActionLink, AjaxHelper.AjaxForm, or other functions that use the route parameter, I find that the route parameter does not support passing IDictionary<string, Object>or RouteValue Dictionary.
Additionally, additionalViewData parameter used by HtmlHelper.Editor does not support access to IDictionary<string, Object> or RouteValue Dictionary.
I looked at the source code, which should be TypeHelper.ObjectToDictionary
Perhaps you should consider adding the following code
public static RouteValueDictionary ObjectToDictionary(object value)
{
if(value == null)
{
return new RouteValueDictionary();
}
if(value is RouteValueDictionary)
{
return value as RouteValueDictionary;
}
if(value is IDictionary<string,object>)
{
return new RouteValueDictionary(value as IDictionary<string, object>);
}
RouteValueDictionary dictionary = new RouteValueDictionary();
if (value != null)
{
foreach (PropertyHelper helper in PropertyHelper.GetProperties(value))
{
dictionary.Add(helper.Name, helper.GetValue(value));
}
}
return dictionary;
}
Thanks for contacting us.
We're not making any improvements in this area any more as this project is in maintenance mode. Only critical blocking issue with wide impact and security issues are considered.
In using
HtmlHelper.ActionLink
,AjaxHelper.AjaxForm
, or other functions that use theroute
parameter, I find that the route parameter does not support passingIDictionary<string, Object>
orRouteValue Dictionary
. Additionally,additionalViewData
parameter used byHtmlHelper.Editor
does not support access toIDictionary<string, Object>
orRouteValue Dictionary
. I looked at the source code, which should beTypeHelper.ObjectToDictionary
Perhaps you should consider adding the following code