You create your Code Behind as normal. You'll need to include the Microsoft.Sharepoint classes that you'll use. Base your Master Page on "System.Web.UI.MasterPage" and your Page Layouts will be "Microsoft.SharePoint.Publishing.PublishingLayoutPage". If you plan to add any controls, do that in the "CreateChildControls()" method. That method is also were you will wire up any events you want for those controls.
Now in your ASPX page, reference the assembly at the top, like:
<%@ Assembly Name"your.assembly.name, version=1.0.0.0, Culture=neutral, Publickeytoken=####" %>
Next add the "Inherits" like:
<%@ Page language="C#" Inherits="your.assembly.name.ClassName"%>
After you build your project, put the DLL in the GAC or the Bin folder of the web application. Then you'll need to reference the DLL in the web.config as a SafeControl.
Now, the page that is using the Page Layout should be using your code behind.
Showing posts with label Page Layouts. Show all posts
Showing posts with label Page Layouts. Show all posts
Sunday, August 26, 2007
Subscribe to:
Posts (Atom)