Placing the form tag within dynamically generated text...

Discussion in 'ASP .Net' started by Stu, Jan 4, 2005.

  1. Stu

    Stu Guest

    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
     
    Stu, Jan 4, 2005
    #1
    1. Advertising

  2. "Stu" <> wrote in message
    news:...
    > 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
     
    John Saunders, Jan 4, 2005
    #2
    1. Advertising

  3. Stu

    Stu Guest

    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


    "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
    news:%...
    > "Stu" <> wrote in message
    > news:...
    >> 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
    >
    >
     
    Stu, Jan 4, 2005
    #3
  4. "Stu" <> wrote in message
    news:%...
    > 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



    > "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
    > news:%...
    >> "Stu" <> wrote in message
    >> news:...
    >>> 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
    >>
    >>

    >
    >
     
    John Saunders, Jan 4, 2005
    #4
  5. Stu

    Stu Guest

    That'll do it - many thanks.

    "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
    news:...
    > "Stu" <> wrote in message
    > news:%...
    >> 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
    >
    >
    >
    >> "John Saunders" <johnwsaundersiii at hotmail.com> wrote in message
    >> news:%...
    >>> "Stu" <> wrote in message
    >>> news:...
    >>>> 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
    >>>
    >>>

    >>
    >>

    >
    >
     
    Stu, Jan 6, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. shruds
    Replies:
    1
    Views:
    829
    John C. Bollinger
    Jan 27, 2006
  2. =?Utf-8?B?ZGF2ZS5kb2xhbg==?=

    html forms within the server generated form tag

    =?Utf-8?B?ZGF2ZS5kb2xhbg==?=, Jun 6, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    363
    =?Utf-8?B?ZGF2ZS5kb2xhbg==?=
    Jun 6, 2006
  3. Nathan Sokalski

    Placing control tag text in a multiline TextBox

    Nathan Sokalski, Jan 3, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    512
    Nathan Sokalski
    Jan 3, 2008
  4. Nathan Sokalski

    Placing control tag text in a multiline TextBox

    Nathan Sokalski, Jan 3, 2008, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    205
    Nathan Sokalski
    Jan 3, 2008
  5. M Wells
    Replies:
    0
    Views:
    141
    M Wells
    Oct 6, 2004
Loading...

Share This Page