Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Forms don't work in kentico.... View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
Gitesh - 3/17/2011 9:40:30 PM
   
Forms don't work in kentico....
Hi Guys,

I have noticed that whenever I insert a form tag in my code in the editor, it deletes the form tag automatically.

Is there a way to make the forms run in kentico?

Thanks
Gitesh Shah


User avatar
Member
Member
dima - 3/18/2011 2:43:59 AM
   
RE:Forms don't work in kentico....
Hi

you just can't do it because asp.net allows you to have only one single form on the page.
if have a look at the page source code, produced by kentico cms - you'll see that the entire of the page is placed inside a form tag.

anyway - why would you need it?

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 3/18/2011 6:35:17 AM
   
RE:Forms don't work in kentico....
Hi,

Kentico CMS does not allow you to use several form tags on one page (only one is allowed). There is already one form tag used on the page therefore inserting another form tag into page, you would create following code:

<form runat="server"> //kentico
<form method=""post>//your
</form> //your
</form> //kentico


As you can see this in not what you would like to achieve.

In general, if you would like to post data from the form control you can use one of following ways:
1. use iframe and insert the whole page code into it
2. use webclient class to post data instead of form control. You can find an example here: www.netomatix.com/httppostdata.aspx

If you need to add a form into editable region, you could create a inline control and apply methods from the point 2 in it.

Best regards,
Ivana Tomanickova