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

T

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
 
K

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
 
T

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";
 
S

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" <[email protected]>
| 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: <[email protected]>
| References: <[email protected]>
| <[email protected]>
| 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: (e-mail address removed)
| NNTP-Posting-Date: Thu, 15 Dec 2005 17:02:36 +0000 (UTC)
| In-Reply-To: <[email protected]>
| 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: (e-mail address removed)
| 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
| 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";
|
|
 

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

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top