Example #1
0
        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>");
        }
Example #2
0
 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));
 }
Example #3
0
 public static MvcHtmlString ActionImage(this HtmlHelper helper, string action, object routeValues, string imagePath, string alt)
 {
     return(helper.ActionImage(action, null, routeValues, imagePath, alt));
 }
Example #4
0
 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)));
 }
Example #5
0
 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));
 }
Example #6
0
 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));
 }
Example #7
0
 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()));
 }
Example #8
0
 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()));
 }