Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • ianhoughton 281 posts 605 karma points c-trib
    Jun 17, 2010 @ 14:14
    ianhoughton
    0

    A page can have only one server-side Form tag error

    I've just created my own usercontrol (Contact form) and ran into this error. I've searched the forum and read the other posts on multiple form tags. My problem is that I can't find any other form tags in my templates.

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Jun 17, 2010 @ 14:39
    Stefan Kip
    0

    You can test this easily, just request a page without the form-tag in you usercontrol (so the website will be shows, instead of the error), view the source and find '<form'

  • ianhoughton 281 posts 605 karma points c-trib
    Jun 17, 2010 @ 14:55
    ianhoughton
    0

    In my page source I have this:

    <!-- <form method="post" action="/your-zone/application-form.aspx?" onsubmit="javascript:return WebForm_OnSubmit();" id="aspnetForm">

    and then a long list of the controls on my form and then a closing form tag. But its all commented out is this being added by the usercontrol itself ?

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Jun 17, 2010 @ 15:24
    Stefan Kip
    0

    I dunno, but without the <form runat="server" /> tag you can't use any server-controls... So why would you want to comment out the form tag? The whole idea of ASP.NET web forms builds on this form tag.

    And why do you want another form tag in you usercontrol?

  • ianhoughton 281 posts 605 karma points c-trib
    Jun 17, 2010 @ 15:53
    ianhoughton
    0

    I'd commented out the form tag previously as it was giving me an error on another page. It appears that ASP.NET was seeing the commented out section and was "thinking" there was a form there.

    I've now removed the commented out code and placed another form tag on another template, which has fixed the issue.

    Thanks for your help.

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Jun 17, 2010 @ 18:09
    Stefan Kip
    0

    You can also comment it out the real way, with: <%-- <form bla bla> --%> ;-)

Please Sign in or register to post replies

Write your reply to:

Draft