共用方式為


NonActionAttribute.IsValidForRequest Method

Determines whether the attribute marks a method that is not an action method by using the specified controller context.

Namespace:  System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

Syntax

'Declaration
Public Overrides Function IsValidForRequest ( _
    controllerContext As ControllerContext, _
    methodInfo As MethodInfo _
) As Boolean
public override bool IsValidForRequest(
    ControllerContext controllerContext,
    MethodInfo methodInfo
)
public:
virtual bool IsValidForRequest(
    ControllerContext^ controllerContext, 
    MethodInfo^ methodInfo
) override

Parameters

Return Value

Type: System.Boolean
true if the attribute marks a valid non-action method; otherwise, false.

Remarks

You must override this method in order to define a valid method for your purposes. Otherwise, this method always returns false.

See Also

Reference

NonActionAttribute Class

System.Web.Mvc Namespace