本文整理汇总了C#中System.Web.Mvc.ViewContext.HtmlHelper方法的典型用法代码示例。如果您正苦于以下问题:C# ViewContext.HtmlHelper方法的具体用法?C# ViewContext.HtmlHelper怎么用?C# ViewContext.HtmlHelper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.Mvc.ViewContext
的用法示例。
在下文中一共展示了ViewContext.HtmlHelper方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderItemColumn
public override IHtmlString RenderItemColumn(ViewContext viewContext)
{
var data = (User)DataItem;
var linkText = "Reset password".Localize();
var @class = "o-icon password dialog-link";
return viewContext.HtmlHelper().ActionLink(linkText, "ResetPassword", viewContext.RequestContext.AllRouteValues().Merge("userName", data.UserName), new Dictionary<string, object> { { "class", @class } });
}
示例2: RenderItemColumn
public override IHtmlString RenderItemColumn(ViewContext viewContext)
{
var data = (OutgoingQueue)DataItem;
var linkText = "Logs".Localize();
return viewContext.HtmlHelper().ActionLink(linkText, "Logs",viewContext.RequestContext.AllRouteValues()
.Merge("UUID", data.UUID).Merge("return", viewContext.HttpContext.Request.RawUrl));
}
示例3: RenderItemColumn
public override IHtmlString RenderItemColumn(ViewContext viewContext)
{
var data = (PendingWorkflowItem)DataItem;
var linkText = "Edit".Localize();
var @class = "dialog-link";
if (!string.IsNullOrEmpty(this.GridColumn.PropertyName))
{
linkText = this.PropertyValue == null ? "" : PropertyValue.ToString();
}
else
{
@class = "o-icon edit " + @class;
}
return viewContext.HtmlHelper().ActionLink(linkText, "Edit", viewContext.RequestContext.AllRouteValues()
.Merge("Controller", "TextContent").Merge("FolderName", data.UUID).Merge("UUID", data.UUID)
, new Dictionary<string, object> { { "class", @class } });
}
示例4: RenderItemColumn
public override IHtmlString RenderItemColumn(ViewContext viewContext)
{
if (DataItem is IIdentifiable)
{
var data = (IIdentifiable)DataItem;
var linkText = "Edit".Localize();
var @class = Class;
if (!string.IsNullOrEmpty(this.GridColumn.PropertyName))
{
linkText = this.PropertyValue == null ? "" : PropertyValue.ToString();
}
else
{
@class = "o-icon edit " + @class;
}
return viewContext.HtmlHelper().ActionLink(linkText, "Edit", viewContext.RequestContext.AllRouteValues().Merge("UUID", data.UUID), new Dictionary<string, object> { { "class", @class } });
}
return new HtmlString("");
}
示例5: RenderItemColumn
public override IHtmlString RenderItemColumn(ViewContext viewContext)
{
if (DataItem is Kooboo.CMS.Common.Persistence.Non_Relational.IIdentifiable)
{
var data = (Kooboo.CMS.Common.Persistence.Non_Relational.IIdentifiable)DataItem;
var linkText = string.Empty;
var @class = string.Empty;
if (!string.IsNullOrEmpty(this.GridColumn.PropertyName))
{
linkText = this.PropertyValue == null ? "" : PropertyValue.ToString();
}
else
{
@class = "o-icon " + @class;
}
return viewContext.HtmlHelper().ActionLink(linkText, "Detail", viewContext.RequestContext.AllRouteValues()
.Merge("UUID", data.UUID).Merge("return", viewContext.HttpContext.Request.RawUrl)
, new Dictionary<string, object> { { "class", @class } });
}
return new MvcHtmlString(string.Empty);
}