DocumentUrlContext.TryResolveUrl Method
- Namespace
- Kampute.DocToolkit.Routing
- Assembly
- Kampute.DocToolkit.dll
Definition
Attempts to resolve a documentation-root-relative URL into an absolute or document-relative URL.
public bool TryResolveUrl(string url, [NotNullWhen(true)] out string resolvedUrl)Parameters
urlstring- A URL beginning with
~/, where the marker represents the documentation root rather than the web site's root. resolvedUrlstring- When this method returns, contains the resolved URL if resolution succeeded; otherwise,
null.

URLs are interpreted according to their prefix and the active document context:
- A documentation-root-relative URL beginning with
- A site-root-relative URL beginning with
- An ordinary document-relative URL is not resolved.
- Query strings and fragments are preserved.
- Dot segments are resolved within the documentation root; a path that navigates above that root is not resolved.
The operation preserves the query string and fragment components of the URL, if present.~/is resolved from the documentation root./is not resolved.