本文整理汇总了C#中System.Web.Mvc.HtmlHelper.Action方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlHelper.Action方法的具体用法?C# HtmlHelper.Action怎么用?C# HtmlHelper.Action使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.Mvc.HtmlHelper
的用法示例。
在下文中一共展示了HtmlHelper.Action方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderTemplate
public string RenderTemplate(HtmlHelper htmlHelper, ContentItem item, IContentItemContainer container, string action)
{
RouteValueDictionary routeValues = new RouteValueDictionary();
routeValues.Add(ContentRoute.ContentItemKey, item);
routeValues.Add(ContentRoute.AreaKey, _controllerMapper.GetAreaName(item.GetType()));
return htmlHelper.Action(action,
_controllerMapper.GetControllerName(item.GetType()),
routeValues).ToString();
}
示例2: Widget
private static MvcHtmlString Widget(HtmlHelper htmlHelper,string actionName,RouteValueDictionary routeValueDictionary)
{
return htmlHelper.Action(actionName, "Widget", routeValueDictionary);
}
示例3: RenderComponentPresentation
private static MvcHtmlString RenderComponentPresentation(IComponentPresentation cp, HtmlHelper htmlHelper)
{
string controller = ConfigurationHelper.ComponentPresentationController;
string action = ConfigurationHelper.ComponentPresentationAction;
if (cp.ComponentTemplate.MetadataFields != null && cp.ComponentTemplate.MetadataFields.ContainsKey("controller"))
{
controller = cp.ComponentTemplate.MetadataFields["controller"].Value;
}
if (cp.ComponentTemplate.MetadataFields != null && cp.ComponentTemplate.MetadataFields.ContainsKey("action"))
{
action = cp.ComponentTemplate.MetadataFields["action"].Value;
}
LoggerService.Debug("about to render component presentation with controller {0} and action {1}", LoggingCategory.Performance, controller, action);
//return ChildActionExtensions.Action(htmlHelper, action, controller, new { componentPresentation = ((ComponentPresentation)cp) });
MvcHtmlString result = htmlHelper.Action(action, controller, new { componentPresentation = ((ComponentPresentation)cp) });
LoggerService.Debug("finished rendering component presentation with controller {0} and action {1}", LoggingCategory.Performance, controller, action);
return result;
}
开发者ID:flaithbheartaigh,项目名称:dynamic-delivery-4-tridion,代码行数:22,代码来源:DefaultComponentPresentationRenderer.cs