views:

90

answers:

1

As part of our branding of Sharepoint 2010, we'll be modifying some custom HTML menu's based on database and user permissions.

To do this, we are looking at the use of code-behind in a custom Sharepoint 2010 master page.

The only reference I can find to creating a code-behind file for sharepoint 2010 is this blog post series. The issue I have with this is that it's using the Visual Studio 2010 Sharepoint integration, which has the genius feature of requiring a local instance of an entire Sharepoint site. This isn't something that I can do/get.

This is the MSDN for code-behind master pages in Sharepoint 2007. I'm assuming it's similar but I can't find anywhere that describes it as such.

Is deploying a code-behind for a custom master page the same as in Sharepoint 2007 or does anyone have any experience doing this?

+1  A: 

You should probably look into creating a custom server/user control and incorporating it in your masterpage by markup, I would not recommend adding the code into the masterpage codebehind itself, i just believe that you need to separate layout and functionality. But in all other respects you can treat SP 2010 in the same way as 2007. I found very little difference regarding backwards compatibility, with major ones being stricter HTML standards and increased code security

Vladi Gubler
Thanks for the idea. I hadn't considered a custom server control. I'll investigate :)
Alastair Pitts
After some investigation, I think that the custom server control is the way to go for this. Thanks!
Alastair Pitts
Excellent! that's what I would do
Vladi Gubler