I want to add a code behind file to check the user's group. But I cannot find the code behind file for home.aspx. How can I create one?
.cs file types are not visible for SharePoint pages/pagelayouts.
In order for you to add your own to one of the Out-of-the-box pages like Home.aspx you'll have to
- Create a new .cs file in Visual Studio which derives from either
public class MyCustomCodeBehindForHomeAspx : Page
- Then you have to open Home.aspx in e.g. SharePoint Designer and add the fully qualified name
<%@ Page Language="C#" DynamicMasterPageFile="~masterurl/default.master" Inherits="MyNamspace.MyCustomCodeBehindForHomeAspx, fully qualified assembly name here" %>