I am tryin to override the SiteMapProvider "CurrentNavigation" in nightandday.master. I got the code to override the class, but i am not sure how i handle the deploy process. A colleague told me that there is a way to deploy that using a "Feature" in VS2010. So i created a new Feature, bound CustomSitemapProvider.cs to it, and deployed everything.. As you probably expect now.. nothing changed. Do i have to change the Deployment Type? Or am i on the completely wrong track now?
Edit: I tried that with the Feature now... I got a elements.xml:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Control Id="AdditionalPageHead" Sequence="90" ControlAssembly="CustomSitemapProviderFeature, Version=1.0.0.0, Culture=neutral, PublicKeyToken=841c5c559877013a" ControlClass="CustomSitemapProviderFeature.CustomSitemapProvider"/>
</Elements>
And just a "Test Feature"..:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;
namespace CustomSitemapProviderFeature
{
class CustomSitemapProvider : WebControl
{
protected override void OnLoad(EventArgs e)
{
string helloAlert = "alert('Hello, world!');";
this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "popup", helloAlert, true);
Label lab = new Label();
lab.Text = "TEST";
this.Page.Controls.Add(lab);
base.OnLoad(e);
}
}
}
Well .. I am able to deploy that... but nothing happens... I am not able to run my code through a Feature... My plan is to override the whole SitemapProvider through such a class..