Cannot set the Title-property of a page in asp.net
I have a weird problem in asp.net.
I have a page in which I can't set the Title
-property under some circumstances.
If I set the Title
-property to a string-value in Page_PreLoad, then the value is empty. 开发者_JS百科However this happens only in some circumstances, I don't understand really when.
If I set a breakpoint and look with the debugger, after setting Title="test";
, the Title property is empty. However the PageTitle in the browser shows "test". If I use the Title-property in the markup of the page, it is empty. Is there some special magic with the Title-property, I have to know about?
The Page.Title property is a wrapper around the HtmlHead control, which is exposed through Page.Header. Before the header gets initialized, it stores the title in a property until it gets initialized. Whenever the Header gets established, it copies this property over... That may be what the issue is, or maybe its something else...
HTH.
精彩评论