I need to write some code that registers an event handler for the SiteMapResolve event of the default SiteMapProvider, using the ExpandPath method of the SiteMapHelper static class to handle the SiteMapResolve event. the SiteMasterHelper function ExpandPath looks like this:
public static SiteMapNode ExpandPath(Object sender, SiteMapResolveEventArgs e)
{ //...}
I have never used event handlers so I am some what lost. Here is what I have attempted but don’t know I am on the right track:
<script RunAt="server">
void Application_Start(object sender, EventArgs e)
{
// SiteMap.SiteMapResolve += SiteMapHelper.ExpandPath(SiteMap.SiteMapResolve);
// SiteMapHelper.ExpandPath(sender, e);
}
</script>
If you want to attach the eventhandler-method called “ExpandPath” to the SiteMapResolve event, it should look like this
or shorter
And the method definition in SiteMapHelper should be