Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 1st, 2012  |  syntax: None  |  size: 1.00 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. right way to specify the src for an image in MVC3
  2. <img src="images/img2.jpg" alt="" title="" />
  3.        
  4. <img src="@Url.Content("~/images/img2.jpg")" alt="" title="" />
  5.        
  6. public static class ImageExtensions
  7. {
  8.     public static MvcHtmlString Image(this HtmlHelper helper, string imageRelativeUrl);
  9.  
  10.     public static MvcHtmlString Image(this HtmlHelper helper, string imageRelativeUrl, string alt);
  11.  
  12.     public static MvcHtmlString Image(this HtmlHelper helper, string imageRelativeUrl, string alt, object htmlAttributes);
  13.  
  14.     public static MvcHtmlString Image(this HtmlHelper helper, string imageRelativeUrl, object htmlAttributes);
  15.  
  16.     public static MvcHtmlString Image(this HtmlHelper helper, string imageRelativeUrl, IDictionary<string, object> htmlAttributes);
  17.  
  18.     public static MvcHtmlString Image(this HtmlHelper helper, string imageRelativeUrl, string alt, IDictionary<string, object> htmlAttributes);
  19.  
  20.     public static TagBuilder Image(string imageUrl, string alt, IDictionary<string, object> htmlAttributes);
  21. }