If you have little C# and ASP.NET knowleges you can make the following.
Please, note, master page layout is classical ASP.NET page, so you can include some server script blocks there. And you can make in this block what your soul wants. :)
Let me show how to make it.
<script runat="server">
protected void pWrapper_Load(object sender, EventArgs e)
{
// Make here some page actions
pWrapper.Visible = false;// Hide our panel for it do not affect page layout
}
</script>
<asp:Panel runat="server" id="pWrapper" OnLoad="pWrapper_Load" />
.... // Other master page layout tags
I do not use Page_Load because it might be used by CMS engine and I do not want to break it.