20 lines
561 B
C#
20 lines
561 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.Mvc;
|
|
|
|
namespace StockManMVC.Models
|
|
{
|
|
public static class ImageHelper
|
|
{
|
|
public static MvcHtmlString Image(this HtmlHelper helper, string src, string altText, string height)
|
|
{
|
|
var builder = new TagBuilder("img");
|
|
builder.MergeAttribute("src", src);
|
|
builder.MergeAttribute("alt", altText);
|
|
builder.MergeAttribute("height", height);
|
|
return MvcHtmlString.Create(builder.ToString(TagRenderMode.SelfClosing));
|
|
}
|
|
}
|
|
} |