Problems creating head section - Unrecognized tag prefix or device filter 'asp'

L

Luurs

Hi All,

I've been using a asp-label in the HTML <head> section for quite some
time in order to dynamically generate meta-keywords,-description, css
and js references.
Though the actual HTML-output isn't that pretty (<span>'s in the
head-section...) it works fine with browsers, crawlers. It never REALLY

was an issue...

However, in VS2005 this method is considered to be an error
"Unrecognized tag prefix or device filter 'asp'". I do understand it's
because the label is not placed within the <FORM>, etc, etc...
Still, Is there a good reason why "suddenly" the method is thought to
be an "Error"?
Will it have any consequences, now or in the near future if I just
ignore the error-warning and continue using the method?
If NOT, can I filter out this specific error from the error-list
(Without loosing the "Unrecognized tag prefix or device filter
'asp'"-error for other occasions)?
If YES, is there a good alternative available?

The MSDN solution
http://msdn.microsoft.com/library/en-us/MCMSSDK02/html/9a042924-3a16-...

is just another way of creating the same problem.
I did quite some searching/trying out myself, but all option had their
disadvantages so far...

The desired solution would be something like this:
<head id="PageHead" runta="server"> in the .aspx file, and in the
codebehind something like:
HtmlGenericControl pageHead =
(HtmlGenericControl)this.Page.FindControl("PageHead");
pageTitle.InnerText = "page-title, Meta/etc-stuff in here";

This works great, and it also removes the annoying
<meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
from the head section!

However, somehow a second (empty) <title></title> is inserted just
before </head>!
It, needs no explanation that this is unwanted behavior...
Is it a ASP.Net issue or a CMS-feature?
Does anyone know why, how and when this is happening?

I really want to move our VS 2005 solution to runtime, but feel
uncertain about the current situation (as described on top of this
post).

I'm using MCMS 2002 enterprise with SP2 and VS 2005 prof. edition on a
Windows Server 2003...

Any help would be much appreciated!
Luurs
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

It's not a good idea, and IMO it's simply wrong !

you can make reference to ANY HTML tag you want in the server side by
inserting a runat=server and in the server side you declare it as
Htmlgenericcontrol.
 
L

Luurs

Hi Ignacio,
Thanks for your reply,

This is exactly what is described above, and the issue in this case is
the insertion of an EXTRA title-tag, after the head-section is
populated with all the stuff I want...
So there's one title-tag generated on server side, and a second empty
one (inserted without intension).

When you say "It's not a good idea", what exactly do you mean?

It's true you can make a reference to ANY HTML tag, so you could create
a reference for e.g. <title>. That will just work out fine, and is
actually my old/ current situation...
However, using this method for any other head-element will result in
HTML-mess...

The reason I picked the HEAD-tag is because it will clear all unwanted
"HEAD-content" in runtime, and I'm free to choose whatever I DO want to
have in there, with decent HTML-formatting...

The combination of <head id="PageHead" runta="server">
and
HtmlGenericControl pageHead =
(HtmlGenericControl)this.Page.FindControl("PageHead");
pageHead.InnerText = "page-title, Meta/etc-stuff in here";
Does exactly that...

My question "Does anyone know why, how and when this is happening?"
(the secondly inserted title-tag) remains...

Anyone ?
 

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