Programmatically setting master page from parent site

Below is a code snippet for Programmatically inheriting master page from parent site

PublishingWeb area = PublishingWeb.GetPublishingWeb(web);
                area.Navigation.InheritGlobal = true;

                area.MasterUrl.SetInherit(truetrue);
                area.AlternateCssUrl.SetInherit(truetrue);


                area.Update();

Comments