Placing the form tag within dynamically generated text...

S

Stu

Hi,

I am writing a content management system that has to have W3C compliant
output. The pages are template driven and there are special strings within
the template to be used as placeholders for the content. However, when I
output the content to a literal (as shown below) the body and html tags are
within the form tags.

Is there any way to position the form tags within the dynamically generated
text (ie to just after the opening body tag)?

Also, can anyone point me in the direction of a good tutorial for writing
W3C compliant sites in .Net?

Page in front code:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="default.aspx.vb"
Inherits="MyProj._default" %>
<form id="Form1" method="post" runat="server">
<asp:Literal id="litOut" runat="server"></asp:Literal>
</form>
Thanks in advance,

Stu
 
J

John Saunders

Stu said:
Hi,

I am writing a content management system that has to have W3C compliant
output. The pages are template driven and there are special strings within
the template to be used as placeholders for the content. However, when I
output the content to a literal (as shown below) the body and html tags
are within the form tags.

Is there any way to position the form tags within the dynamically
generated text (ie to just after the opening body tag)?

Also, can anyone point me in the direction of a good tutorial for writing
W3C compliant sites in .Net?

Page in front code:
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="default.aspx.vb" Inherits="MyProj._default" %>
<form id="Form1" method="post" runat="server">
<asp:Literal id="litOut" runat="server"></asp:Literal>
</form>

If you create a normal .aspx page with the above code, I think you'll find
that the <form> tag is within the <html> and <body> tags. If the <form> tag
is outside, then I think your code must be doing that.

John Saunders
 
S

Stu

Hi,

Yes, this is the point. Each html template requires different headers
(title, stylesheet etc) so I am writing them dynamically in to the page. Is
there and way of forcing the form tag to within the content I am writing to
the literal?

Thanks in advance,

Stu
 
J

John Saunders

Stu said:
Hi,

Yes, this is the point. Each html template requires different headers
(title, stylesheet etc) so I am writing them dynamically in to the page.
Is there and way of forcing the form tag to within the content I am
writing to the literal?

You've already got one form tag surrounding the literal, and you want
another one inside of it?

Instead, you should do something like the following:

<html>
<head id="header" runat="server"></head>
<body>
<form id="form1" runat="server">
</form>
</body>
</html>

Then, you can add controls to header.Controls.

John Saunders
 
S

Stu

That'll do it - many thanks.

John Saunders said:
You've already got one form tag surrounding the literal, and you want
another one inside of it?

Instead, you should do something like the following:

<html>
<head id="header" runat="server"></head>
<body>
<form id="form1" runat="server">
</form>
</body>
</html>

Then, you can add controls to header.Controls.

John Saunders
 

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,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top