One of the things we frequently see when a client-project uses masterpages is the following type-cast:
MasterPageType myMasterPage = Page.Master as MasterPageType;
To avoid this type-cast you can simply add the following directive to your page:
<%@ MasterType VirtualPath="~/Site.master" %>
Adding this directive to your page will make the
Master property strongly-typed (
Page.Master remains loosely-typed) to your masterpage eliminating the need to do the aforementioned type-cast.