Interface IHandleUrlForRewrite
Interface for handling URL rewriting in the HierarchicalUrlRewriteProvider.
Namespace: EPiServer.Web
Assembly: EPiServer.dll
Version: 8.11.0Syntax
public interface IHandleUrlForRewrite
Remarks
This interface handles non-cached requests for a specific URL
Properties
UrlRewritten
Gets a value indicating whether the URL was rewritten as a result of the TryHandleUrl method.
Declaration
bool UrlRewritten { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Methods
TryHandleUrl(UrlRewriteContext, ref Object, ref CachedUrlHandler)
Tries to handle the URL gven in the context.
Declaration
bool TryHandleUrl(UrlRewriteContext context, ref object internalObject, ref CachedUrlHandler handler)
Parameters
Type | Name | Description |
---|---|---|
UrlRewriteContext | context | The context for the rewrite. Note that the URL of the context may be modified. |
System.Object | internalObject | The internal object representation. |
CachedUrlHandler | handler | The cached handler. |
Returns
Type | Description |
---|---|
System.Boolean | True if the URL was recognized and handled, False otherwise. |
Remarks
If this method returns False (URL not handled), then the context, internalObject and handler should be unaffected.
If the method returns True (URL handled), then UrlRewritten will indicate if the context.Url property has been modified. The method may optionally return a CachedUrlHandler in the handler parameter in this case as well.
Returning a non-null value in handler is how you indicate that you have want to cache expensive url lookups and reuse for subsequent calls.