changing the title from a PageBase class

  • Thread starter Thread starter z f
  • Start date Start date
Z

z f

Hi,
if i use a base class for my pages PageBase inherits system.web.page
can i control the title of my inheriting pages without midifying the pages
directly or adding a runat=server to the title element?

TIA, z.
 
sure, walk the controls collection of the page, inpect the literal controls
inner html looking for <title>. replace the control contents with what you
want. you may have to add the <head> (or even the head if it was not on the
page).

basically the the stuff on the page before the <form> (and after </form>) is
in literal controls, so its easy to modifiy.

-- bruce (sqlwork.com)


| Hi,
| if i use a base class for my pages PageBase inherits system.web.page
| can i control the title of my inheriting pages without midifying the pages
| directly or adding a runat=server to the title element?
|
| TIA, z.
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top