Posted on:
Categories: SharePoint

I ran into a puzzling issue the other day while developing a custom web part - after ajax postbacks via the .net UpdatePanel control, the page title would become completely blank in the browser.  Turns out, you may have (like me) formatted your master page such that the ContentPlaceHolder for the page title looked like this:

<title id="onetidTitle">
   <asp:ContentPlaceHolder id="PlaceHolderPageTitle" runat="server"/>

It looks nice, and the page title seems to display fine in all browsers on initial load. However, after an asynchronous partial postback - for example, the UpdatePanel in my web part, the title completely disappears from the browser title bar!

Blank IE Tab Screenshot

...Turns out, it's the nice formatting in the Master Page!

If you remove the new lines and tabs, and just put everything in 1 line (like it is in the original v4.master), you will notice that even after posting back via the UpdatePanel, the title remains there no problem.

<title id="onetidTitle"><asp:ContentPlaceHolder id="PlaceHolderPageTitle" runat="server"/></title>