using System.Web.UI.HtmlControls;
Sınıfını ekliyoruz.
protected void Page_Load(object sender, EventArgs e)
{
HtmlGenericControl body = (HtmlGenericControl)Master.FindControl(“PageBody”);
body.Attributes.Add(“class”, “BuradaClassEkledim”);}
Burada HtmlGenericControl oluşturup; <body id=”PageBody” runat=”server”> PageBody id’sini buluyoruz.
Daha sonra body.Attributes.Add(“class”,”BuradaClassEkledim”); ile ekleme işlemi yapıyoruz, çıktısı aşağıdaki gibi oluyo
<body id="PageBody" class="BuradaClassEkledim"> MasterPage içindeki herhangi bir attribute için HtmlGenericControl ile değişiklik yapabilirsiniz. Daha fazla detaylı bilgi için http://www.buraksenyurt.com/post/Profesyonelce-Master-Pages-bsenyurt-com-dan.aspx Sayfasını ziyaret edebilirsiniz.