I am using master pages and having trouble setting page title from @ Page Directive. All of my classes come from a class myPage , which are obtained from the ASP.NET System.Web.UI.Page class. Please note: is the runat = "server" set in the head tag of my master page.
Here's what I see for the @page instructions file test.aspx.vb :
& lt;% @ page language = "VB" masterpagefile = "~ / MainMaster.master" autoeventwireup = "wrong" codefile = "test.aspx.vb" inherits = "test" title = "test"%> test.aspx.vb looks like this: Partial class testing myPage protected sub page_Load
This is my master file, MainMaster.master , looks like: / P>
DOCTYPE HTML PUBLIC "- // W3C / DTD HTML 4.01 // n" "http: / /www.w3.org/TR/html4/strict.dtd">#ltml; xmlns = "http://www.w3.org/1999/xhtml">
< P> Now, when you go to a browser to see test.aspx , you expect to see the title 'test' but instead you can say 'untitled' according to the master page. Through trial and error, I modified the test class from System.Web.UI.Page to get directly instead of myPage Done:
partial class test page protected sub page_Load (ByVal as e-object, system As an e-agent in the form of Event basis) Mail load and sub end class
And everything worked fine @ pages are set correctly in the directory by setting them to system.Web.UI.Page myPage be instead of em>?
I realize that I can set page titles with the title of the program through all the pages of the page through the Page_Load methods, but I can do it in the. Want to do
This is a very strange and depressing problem, and I'm getting hurt!
Thanks !!!
I thank everyone for their help; The problem I had found was that there was a property for the title in the myPage class, but the change in the set portion of the property was not going on Page.Title because it it should have happened .
One line change has fixed my problem :)
Comments
Post a Comment