Show MonthPicker Div in Quick Launch Sharepoint 2010

First of all add a calender web part to a page. Then open that page in Sharepoint designer and add this tags in end of the home page

<asp:Content ContentPlaceHolderId=”PlaceHolderCalendarNavigator” runat=”server”>
<SharePoint:SPCalendarNavigator id=”CalendarNavigatorId” runat=”server”/>
</asp:Content>

and bingo…. 😀

How to apply HttpModule in SharePoint 2010

In visual studio create a classlibrary lets give it anem MasterPageHttpModule and write this code.

using System;

using System.Web;

using System.Web.UI;

using System.IO;

using Microsoft.SharePoint;

namespace MasterPageHttpModule

{

public class MasterPageHttpModule : IHttpModule

{

public void Init(HttpApplication context)

{

context.PreRequestHandlerExecute += new EventHandler(context_PreRequestHandlerExecute);

}

void context_PreRequestHandlerExecute(object sender, EventArgs e)

{

Page page = HttpContext.Current.CurrentHandler as Page;

if (page != null)

{

page.PreInit += new EventHandler(page_PreInit);

}

}

void page_PreInit(object sender, EventArgs e)

{

Page page = sender as Page;

if (page != null)

{

// Is there a master page defined?

if (page.MasterPageFile != null)

{

if (page.MasterPageFile.Contains(“v4.master”))

{

page.MasterPageFile = “/_catalogs/masterpage/custom_master_page.master”;

}

}

}

}

public void Dispose()

{

}

}

}

Then give a strong name to this project.

Now build this project and put a dll in GAC.

In SharePoint 2010 we have to add our tag in

<system.webServer>

<modules runAllManagedModulesForAllRequests=”true”>

<add name=”MasterPageHttpModule” type=”MasterPageHttpModule.MasterPageHttpModule,  MasterPageHttpModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a3ae01f27de8c434″/>

</modules>

</system.webServer>

And bingo … 🙂