asp.net - Load page title initial automatically -


today:

on every page "load" event-

page.title = defaultpagetitle + page.title; 

"defaultpagetitle"- string taken "basepage", means every new page, have copy&paste line.

my goal: automatically load initial title suffix every page..

defaultpagetitle="xxx- " if aspx code file title tag <title>page1</title>

the page title "xxx- page1"

in general practice create base class called pagebase inherits system.web.ui.page. inherit aspx pages base class. in way can refactor common code base class.

you can override onload event in pagebase , move code event. need not write code in each page.

other option if using master page, write code set page title in page_load event of master page


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -