public void GivenValidData_WhenIUseTheDisplayACtionImageHelper_IGetValidHtml() { MvcHtmlString result = _helper.ActionImage("/Controller/Action?DocumentId=Id", "~/Images/pdf.gif", "alt", "css"); result.ToString() .Should() .Be( @"<a class=""css"" href=""/Controller/Action?DocumentId=Id""><img alt=""alt"" src=""~/Images/pdf.gif"" /></a>"); }
public static MvcHtmlString ActionImage <TController>(this HtmlHelper helper, Expression <Action <TController> > action, string imageRelativeUrl, string alternativeText, object htmlAttributes) where TController : Controller { return(helper.ActionImage(action, imageRelativeUrl, alternativeText, null, htmlAttributes)); }
public static MvcHtmlString ActionImage(this HtmlHelper helper, string action, object routeValues, string imagePath, string alt) { return(helper.ActionImage(action, null, routeValues, imagePath, alt)); }
public static string ActionImage(this HtmlHelper htmlHelper, string imageUrl, string linkText, string actionName, string controllerName, string protocol, string hostName, string fragment, object routeValues, object htmlanchorAttributes, object htmlImageAttributes) { return(htmlHelper.ActionImage(imageUrl, linkText, actionName, controllerName, protocol, hostName, fragment, new RouteValueDictionary(routeValues), new RouteValueDictionary(htmlanchorAttributes), new RouteValueDictionary(htmlImageAttributes))); }
public static string ActionImage(this HtmlHelper htmlHelper, string imageUrl, string linkText, string actionName, string controllerName, object routeValues, object htmlanchorAttributes) { return(htmlHelper.ActionImage(imageUrl, linkText, actionName, controllerName, new RouteValueDictionary(routeValues), new RouteValueDictionary(htmlanchorAttributes), null)); }
public static string ActionImage(this HtmlHelper htmlHelper, string imageUrl, string linkText, string actionName, RouteValueDictionary routeValues, IDictionary <string, object> htmlanchorAttributes, IDictionary <string, object> htmlImageAttributes) { return(htmlHelper.ActionImage(imageUrl, linkText, actionName, null, routeValues, htmlanchorAttributes, htmlImageAttributes)); }
public static string ActionImage(this HtmlHelper htmlHelper, string imageUrl, string linkText, string actionName, RouteValueDictionary routeValues) { return(htmlHelper.ActionImage(imageUrl, linkText, actionName, null, routeValues, new RouteValueDictionary())); }
public static string ActionImage(this HtmlHelper htmlHelper, string imageUrl, string linkText, string actionName, string controllerName) { return(htmlHelper.ActionImage(imageUrl, linkText, actionName, controllerName, new RouteValueDictionary(), new RouteValueDictionary())); }