Class ContentDataValueProvider
System.Web.Mvc.IValueProvider that extracts the current ContentReference or IContentData instance from the current request.
Inheritance
Implements
Inherited Members
Namespace: EPiServer.Web.Mvc
Assembly: EPiServer.dll
Version: 8.11.0Syntax
public class ContentDataValueProvider : IValueProvider
Constructors
ContentDataValueProvider(RequestContext)
Initializes a new instance of the ContentDataValueProvider class.
Declaration
public ContentDataValueProvider(RequestContext requestContext)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Routing.RequestContext | requestContext | The request context. |
ContentDataValueProvider(RequestContext, ViewContentRetriever)
Initializes a new instance of the ContentDataValueProvider class.
Declaration
public ContentDataValueProvider(RequestContext requestContext, ViewContentRetriever contentRetriever)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Routing.RequestContext | requestContext | The request context. |
ViewContentRetriever | contentRetriever | The content loader. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | requestContext |
Properties
CurrentBlockKey
Gets or sets the argument key that is associated with the current block.
Declaration
public virtual string CurrentBlockKey { get; set; }
Property Value
Type | Description |
---|---|
System.String | The key associated with the current block. |
CurrentContentKey
Gets or sets the argument key that is associated with the current IContentData instance.
Declaration
public virtual string CurrentContentKey { get; set; }
Property Value
Type | Description |
---|---|
System.String | The key associated with the current content data instance. |
CurrentPageKey
Gets or sets the argument key that is associated with the current page.
Declaration
public virtual string CurrentPageKey { get; set; }
Property Value
Type | Description |
---|---|
System.String | The key associated with the current page. |
Methods
ContainsPrefix(String)
Determines whether the current provider contains the given prefix.
Declaration
public bool ContainsPrefix(string prefix)
Parameters
Type | Name | Description |
---|---|---|
System.String | prefix | The prefix to check for. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetValue(String)
Gets the value that is associated with the given key.
Declaration
public ValueProviderResult GetValue(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key associated with the value. |
Returns
Type | Description |
---|---|
System.Web.Mvc.ValueProviderResult | A System.Web.Mvc.ValueProviderResult or null if no value was found for the given |