One More Reason Design Time Sucks

posted on 2004-12-12 at 13:47:54 by Joel Ross

One of the bloggers over at WWWCoder has a post about making the title of an ASP.NET web form dynamic. Basically, you make the title tag run at the server, then declare it as an HtmlGenericControl. Then you can set the InnerText on it, and it works.

While this is good, the point is the last line in the post

"The moment you make any changes to the UI of the ASPX page Visual Studio gets rid of the <runat="server'>"

Just one more reason design time sucks!

In a current project, we solved this problem a different way. We put a custom control inside the title tags, and it works fine. Our control inherits from the Literal control, and allows us to set content in it dynamically by giving it an id it finds in our database. The control inherits from the Literal control, and the only problem design time has given the other developers (I, of course, don't use it) is that it puts a line break before our custom control tag. Other than that, it works fine.

I haven't looked, but does ASP.NET 2.0 have a title tag? That seems like a pretty standard requirement - change the title tag on a page, because it has multiple uses.

Categories: ASP.NET