Form tag bug
Hi Telerik team,
Scenario A:
<body>
<form> *This is the page's form tag*
<div id="container">
<div id="left"></div>
<div id="main"></div>
</div>
</form>
</body>
I believe this is the default scenario so it's a given that everything will fall into place perfectly. Kindly take a look into this:
Scenario B:
<body>
<div id="container">
<div id="left"></div>
<form> *This is the page's form tag*
<div id="main">
<asp:ContentPlaceHolder ID="Content" runat="server" />
</div>
</form>
</div>
</body>
When I apply this mark-up, something goes wrong with the Edit Page view, the widgets, controls, they get mangled and disoriented as though they get "squeezed" into the page. Take a look at the screenshot attached. We have this requirement wherein we would be needing two form tags in the page. The page's default form tag has been inserted farther into the div's because another form tag is needed for the <div id="left"></div>.
Is this a bug?
Hello jkregala,
Thank you for using our services.
Each server side control needs to be added within a runat server form tag. The behavior you are experiencing is due to that reason. If you intend on using more than one form tags you should have the default form tag as usual and either nest the other one inside it or add it somewhere else. Please note that you cannot have more than one runat server form tag on a page at the same time.
Sincerely yours,
Radoslav Georgiev
the Telerik team
Hi Radoslav Georgiev,
The form tag has a runat=server attribute already. Furthermore, our corporate website (which we are currently "Sitefinitizing") has a successful implementation of two server-side form tags. The primary difference between the two form tags is the action attribute used. Each of the two leads to an action destination different from the other.
Hello jkregala,
Could you please show us the markup you are trying to use. With the one from your first post there is no problem? How do you set the runat server property? Do you set it in markup, or dynamically? If I add two forms with runat="server" property set even if they have different actions I get the error message for duplicate form tags.
Greetings,
Radoslav Georgiev
the Telerik team
Pardon me, only one form tag has the runat server attribute.
Anyway, here's the markup:
<
body
>
<
div
id
=
"header"
/>
<
div
id
=
"main"
>
<
div
id
=
"primary"
>
<
form
id
=
"aspnetForm"
runat
=
"server"
>
*primary content here*
</
form
>
</
div
>
<
div
id
=
"secondary"
>
<
form
id
=
"search"
action
=
"/search/"
>
<
div
>
*search form here*
</
div
>
</
form
>
<
div
>
*other website elements here*
</
div
>
</
div
>
</
div
>
<
div
id
=
"footer" /
>
</
body
>
aspnetForm
is placed in the deeper layer of divs. If I do this, the initial error I reported with the screenshot happens.Hello jkregala,
Could it be possible that you have a content place holder control in your page's header. You will not be able to add controls to areas which are not defined with content place holders.
Kind regards,
Radoslav Georgiev
the Telerik team
Nope, there is no content placeholder control in the <
div
id
=
"header"
/>
part of the page. It only has the company logo and the main navigation (which is not a Sitefinity control, but a custom made one)
Hi jkregala,
Thank you for getting back to me.
I am still unable to reproduce the issue. Can you please open a bug report and send us a sample project where this issue reproduces?
All the best,
Radoslav Georgiev
the Telerik team