Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
153 lines (139 sloc) 10.1 KB
<Type Name="SiteMapResolveEventArgs" FullName="System.Web.SiteMapResolveEventArgs">
<TypeSignature Language="C#" Value="public class SiteMapResolveEventArgs : EventArgs" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit SiteMapResolveEventArgs extends System.EventArgs" />
<TypeSignature Language="DocId" Value="T:System.Web.SiteMapResolveEventArgs" />
<TypeSignature Language="VB.NET" Value="Public Class SiteMapResolveEventArgs&#xA;Inherits EventArgs" />
<TypeSignature Language="C++ CLI" Value="public ref class SiteMapResolveEventArgs : EventArgs" />
<TypeSignature Language="F#" Value="type SiteMapResolveEventArgs = class&#xA; inherit EventArgs" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.EventArgs</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Provides data for an event that is raised by calling the <see cref="P:System.Web.SiteMapProvider.CurrentNode" /> property of the <see cref="T:System.Web.SiteMapProvider" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.SiteMapResolveEventArgs> class is used in the <xref:System.Web.SiteMapProvider.ResolveSiteMapNode%2A> method to enable subscribers to the <xref:System.Web.SiteMapProvider.SiteMapResolve> event to return an instance of the <xref:System.Web.SiteMapNode> class. By adding an event handler delegate to handle the <xref:System.Web.SiteMapProvider.SiteMapResolve> event, you can create a <xref:System.Web.SiteMapNode> representation of a page without implementing a custom site map provider.
## Examples
The following code example demonstrates how to handle the <xref:System.Web.SiteMap.SiteMapResolve> event on an ASP.NET Web page to modify the target URLs that are displayed by a site navigation control, such as the <xref:System.Web.UI.WebControls.SiteMapPath> control. In this example, the current page is a post page in an online bulletin board or forum. To render more meaningful site navigation, the URLs of the nodes displayed by the navigation control are appended with query strings that are relevant to the context.
**Note** It is safe to access the <xref:System.Web.SiteMap.CurrentNode%2A> property from within the <xref:System.Web.SiteMapResolveEventHandler> class. The ASP.NET site navigation infrastructure guards against infinite recursion, in this case.
[!code-csharp[System.Web.SiteMap.SiteMapResolve#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.SiteMap.SiteMapResolve/CS/sitemapresolve1cs.aspx.cs#1)]
[!code-vb[System.Web.SiteMap.SiteMapResolve#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.SiteMap.SiteMapResolve/VB/sitemapresolve1vb.aspx.vb#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.SiteMapResolveEventHandler" />
<altmember cref="E:System.Web.SiteMap.SiteMapResolve" />
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public SiteMapResolveEventArgs (System.Web.HttpContext context, System.Web.SiteMapProvider provider);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Web.HttpContext context, class System.Web.SiteMapProvider provider) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.SiteMapResolveEventArgs.#ctor(System.Web.HttpContext,System.Web.SiteMapProvider)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (context As HttpContext, provider As SiteMapProvider)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; SiteMapResolveEventArgs(System::Web::HttpContext ^ context, System::Web::SiteMapProvider ^ provider);" />
<MemberSignature Language="F#" Value="new System.Web.SiteMapResolveEventArgs : System.Web.HttpContext * System.Web.SiteMapProvider -&gt; System.Web.SiteMapResolveEventArgs" Usage="new System.Web.SiteMapResolveEventArgs (context, provider)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="context" Type="System.Web.HttpContext" />
<Parameter Name="provider" Type="System.Web.SiteMapProvider" />
</Parameters>
<Docs>
<param name="context">An <see cref="T:System.Web.HttpContext" /> that represents the context of the current page request.</param>
<param name="provider">The <see cref="T:System.Web.SiteMapProvider" /> that raised the <see cref="E:System.Web.SiteMapProvider.SiteMapResolve" /> event.</param>
<summary>Initializes a new instance of the <see cref="T:System.Web.SiteMapResolveEventArgs" /> class using the specified <see cref="T:System.Web.HttpContext" /> and <see cref="T:System.Web.SiteMapProvider" /> objects.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Both the `context` and `provider` parameters might be `null`.
The <xref:System.Web.XmlSiteMapProvider> object initializes a new instance of the <xref:System.Web.SiteMapResolveEventArgs> class with values that are not `null`.
]]></format>
</remarks>
<altmember cref="M:System.Web.SiteMapProvider.ResolveSiteMapNode(System.Web.HttpContext)" />
</Docs>
</Member>
<Member MemberName="Context">
<MemberSignature Language="C#" Value="public System.Web.HttpContext Context { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.HttpContext Context" />
<MemberSignature Language="DocId" Value="P:System.Web.SiteMapResolveEventArgs.Context" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Context As HttpContext" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Web::HttpContext ^ Context { System::Web::HttpContext ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Context : System.Web.HttpContext" Usage="System.Web.SiteMapResolveEventArgs.Context" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.HttpContext</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the context of the page request that the requested node represents.</summary>
<value>An <see cref="T:System.Web.HttpContext" />, if one is specified; otherwise, <see langword="null" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Event subscribers can use the <xref:System.Web.HttpContext> and <xref:System.Web.SiteMapProvider> objects to dynamically create a <xref:System.Web.SiteMapNode> object and retrieve information about the requested page, such as the requested URL, as well as user information.
]]></format>
</remarks>
<altmember cref="T:System.Web.HttpContext" />
</Docs>
</Member>
<Member MemberName="Provider">
<MemberSignature Language="C#" Value="public System.Web.SiteMapProvider Provider { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.SiteMapProvider Provider" />
<MemberSignature Language="DocId" Value="P:System.Web.SiteMapResolveEventArgs.Provider" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Provider As SiteMapProvider" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Web::SiteMapProvider ^ Provider { System::Web::SiteMapProvider ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Provider : System.Web.SiteMapProvider" Usage="System.Web.SiteMapResolveEventArgs.Provider" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.SiteMapProvider</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the <see cref="T:System.Web.SiteMapProvider" /> object that raised the <see cref="E:System.Web.SiteMapProvider.SiteMapResolve" /> event.</summary>
<value>The <see cref="T:System.Web.SiteMapProvider" /> that raised the event; otherwise, <see langword="null" />, if no provider is specified during the <see langword="EventArgs" /> object construction.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Event subscribers can use the <xref:System.Web.HttpContext> and <xref:System.Web.SiteMapProvider> objects to dynamically create a <xref:System.Web.SiteMapNode> object and retrieve information about the requested page, such as the requested URL, as well as user information.
]]></format>
</remarks>
<altmember cref="T:System.Web.SiteMapProvider" />
<altmember cref="E:System.Web.SiteMap.SiteMapResolve" />
<altmember cref="E:System.Web.SiteMapProvider.SiteMapResolve" />
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.