Home All Groups Group Topic Archive Search About

.Net 2, asp:Literal outside a server form = unrecognized tag prefix

Author
15 Dec 2005 3:59 PM
Tim_Mac
hi,
i have a master page, and i want to put an asp:literal control in the
<head><title> section. but it won't build because it says it's an
unrecognized tag prefix.

if i put the control inside a server form it works fine, but i probably
don't want to move the server form to encapsulate the body element,
since that would not be a correct html structure.

any ideas?
thanks
tim

Author
15 Dec 2005 4:18 PM
Karl Seguin
Don't think it's a compile time error.  just an IDE warning.   I get the
same error report in VS.Net, but it compiles fine and works.

Also, in 2.0 there's a nice new property to the page class, Header.
Page.Header.Controls.Add(), might not be useful in your case (unless you
dynamically want to add a header), but thought I'd mention it anyways.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/


Show quoteHide quote
"Tim_Mac" <t**@mackey.ie> wrote in message
news:1134662395.631679.295730@g47g2000cwa.googlegroups.com...
> hi,
> i have a master page, and i want to put an asp:literal control in the
> <head><title> section. but it won't build because it says it's an
> unrecognized tag prefix.
>
> if i put the control inside a server form it works fine, but i probably
> don't want to move the server form to encapsulate the body element,
> since that would not be a correct html structure.
>
> any ideas?
> thanks
> tim
>
Are all your drivers up to date? click for free checkup

Author
15 Dec 2005 5:02 PM
Tim_Mac
hi Karl,
thanks for the tip. it works great.  just for any people stuck on the
same thing, it's dead easy:

this.Page.Header.Title = "Hello";
Author
16 Dec 2005 1:13 AM
Steven Cheng[MSFT]
Thanks for Karl's nice suggestion.

Hi Tim,

Feel free to post here when you need any further help.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Tim_Mac" <t**@mackey.ie>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Subject: Re: .Net 2, asp:Literal outside a server form = unrecognized tag
prefix
| Date: 15 Dec 2005 09:02:31 -0800
| Organization: http://groups.google.com
| Lines: 6
| Message-ID: <1134666151.282342.121***@f14g2000cwb.googlegroups.com>
| References: <1134662395.631679.295***@g47g2000cwa.googlegroups.com>
|    <eUUW3NZAGHA.3***@TK2MSFTNGP10.phx.gbl>
| NNTP-Posting-Host: 83.141.121.205
| Mime-Version: 1.0
| Content-Type: text/plain; charset="iso-8859-1"
| X-Trace: posting.google.com 1134666156 5538 127.0.0.1 (15 Dec 2005
17:02:36 GMT)
| X-Complaints-To: groups-ab***@google.com
| NNTP-Posting-Date: Thu, 15 Dec 2005 17:02:36 +0000 (UTC)
| In-Reply-To: <eUUW3NZAGHA.3***@TK2MSFTNGP10.phx.gbl>
| User-Agent: G2/0.2
| X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8)
Gecko/20051111 Firefox/1.5,gzip(gfe),gzip(gfe)
| Complaints-To: groups-ab***@google.com
| Injection-Info: f14g2000cwb.googlegroups.com; posting-host=83.141.121.205;
|    posting-account=UaxKfw0AAAA4oMLJHydK195yIv1avAma
| Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.gigan
ews.com!postnews.google.com!f14g2000cwb.googlegroups.com!not-for-mail
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:365125
Show quoteHide quote
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| hi Karl,
| thanks for the tip. it works great.  just for any people stuck on the
| same thing, it's dead easy:
|
| this.Page.Header.Title = "Hello";
|
|

Bookmark and Share

Post Thread options