ASP.NET 2 Tag Resolution

C

Chris Welch

Interesting problem. I've begun working with my master page in ASP.NET
2, and I wanted to be able set my <title> tag as an HTML control. So,
after making the necessary changes to the tag, I went into the code
behind and started coding. The problem was that the code behind
recognized my <title> tag as an HtmlGenericControl, instead of the
HtmlTitle control that it really should be.

I tried to override the auto-declaration with my own protected
declaration, but alas, it gave me an error that it was already
declared.

I can work around this issue for now, but I'm worried that we're
loosing control of something and we can't be guaranteed that it will
work 100% of the time.

Anyone know if there will be a way to override these declarations?
 
B

Brock Allen

In 2.0 they've encouraged the <head> to be a server control -- it's now a
defined property on the Page base class, and they've exposed a Title property
for this scenario:

Page.Head.Title = "Welcome";

-Brock
DevelopMentor
http://staff.develop.com/ballen
 

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

Top