Class HtmlHelperExtensions
Extension methods for the Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper interface.
Inheritance
Namespace: Cuemon.AspNetCore.Mvc.Rendering
Assembly: Cuemon.AspNetCore.Mvc.dll
Syntax
public static class HtmlHelperExtensions
Methods
| Improve this DocUseWhen(IHtmlHelper, String, String, Action)
Invokes the delegate body
when the specified action
name and controller
name is matched in Microsoft.AspNetCore.Mvc.ActionContext.RouteData.
Declaration
public static void UseWhen(this IHtmlHelper helper, string action, string controller, Action body)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper | helper | The Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper to extend. |
System.String | action | The action name to match. |
System.String | controller | The controller name to match. |
System.Action | body | The delegate that, when both |
UseWhen<T>(IHtmlHelper, String, String, Func<T>)
Creates a value of T
when the specified action
name and controller
name is matched in Microsoft.AspNetCore.Mvc.ActionContext.RouteData.
Declaration
public static T UseWhen<T>(this IHtmlHelper helper, string action, string controller, Func<T> result)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper | helper | The Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper to extend. |
System.String | action | The action name to match. |
System.String | controller | The controller name to match. |
System.Func<T> | result | The function delegate that, when both |
Returns
Type | Description |
---|---|
T | Either the value of the function delegate |
Type Parameters
Name | Description |
---|---|
T | The type of the value for the matched action method. |