c#,asp.net-mvc,razor,html-helper,tagbuilder
The function you are looking for is: HtmlHelper.AnonymousObjectToHtmlAttributes() https://msdn.microsoft.com/en-us/library/system.web.mvc.htmlhelper.anonymousobjecttohtmlattributes(v=vs.118).aspx Here is one version of the ModalLink Extension: public static MvcHtmlString ModalLink(this HtmlHelper htmlHelper, string title, string linkText, string actionName, string controllerName, object routeValues, object htmlAttributes) { // Add 'show-in-modal' class here // Add 'data-title' attribute here var htmlAttr =...