Previous time we have learned the basic method of use of MasterPages, but we will also find that such templates can not meet the requirements during the actual use. The question first encountered is the page title. For web forms using a template, how should its page title write? In general, the page title is specified by the HTML standard element Title tag, which exists within the HEAD tag. You can now only have a complete HTML tag in the template control, and other forms are just through masterpages "references" these public HTML elements. Then where should the page title should be written? The author first adds a Region in the template
Title>, adds its own page title to the corresponding content of the form. Template code: <% @ register tagprefix = "mp" namespace = "microsoft.web.samples.masterpages" assembly = "masterpages"%> mp: region> title> head> ... body> html> The result is found that MasterPages will not correct the contents of the regtitle as the page title. But at the beginning of the page results show a tag containing the contents of the page title. The author guessing MASTERPAGES does not output Region in , but defines Title in obviously not legal HTML code. Then, you can define a client script function for setting the title in the template, and write this client script function in the background code of the template, and output the content of the Content of the Template in the form of the table. For this parameter, which is dynamically implemented as the function of the form output page title? The author adds a hidden Region in the of the template because its corresponding Content does not need to be output to the page result.
mp: region> ... body> Defines a client script of a set page title in : : < Head> ...