-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSite.Master.cs
29 lines (27 loc) · 899 Bytes
/
Site.Master.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace GraveGates
{
public partial class SiteMaster : MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
// Assuming you're using the filename to determine the current page
string currentPage = System.IO.Path.GetFileNameWithoutExtension(Request.Url.AbsolutePath);
// Set the body class based on the current page
switch (currentPage) {
case "Page2":
bodyTag.Attributes["class"] = "page2";
break;
case "Home":
default:
bodyTag.Attributes["class"] = "home"; // Default class (no specific background)
break;
}
}
}
}