Hi
You can only have one form tag with the runat="server" attribute on a page, but you can have more form tags outside the form tag with runat="server".
Take a look at this post: http://www.frederikvig.com/2009/06/using-multiple-forms-on-an-asp-net-web-forms-page/
Hope this helps
Frederik
Frederik: Thank you very much. I check it out later, got so much work in between. I'll get back. Take care.
Hi!
Ok. Hmm. My masterpage has one form tag with runat="server". Masterpage also has a contentplaceholder. On other aspx pages I have one asp content that sends to the placeholder, so to speak.
The big mystery is that if I place a form tag in any aspx file, just a plain and simple form tag (no attributes), the layout gets messed up in IE8, it works fine in Firefox and IE compatibility mode. Any idea?
it is not possible to nestle formtags. As you've experienced, your MasterPage has one gigantic form tag runat server so you can perform asp.net logic inside of it. Firefox/Chrome will perhaps render your nestled form code, but if you inspect it you'll see that firefox and chrome strips the form tags before rendering the html. If you want nestled forms you'd need to put it into an iframe as far as I know.
Andreas: Hi, thank you. Hmm, what about those forms that editors can do, how do thet get tackled? They work.
I have heard somewhere that an option is to not write nestled form tags, instead just write code for fields and buttons (including a submit button) and then with code make it so that it gets posted where you want. But I dont know how to do that.
What you are referring to is Xforms, technote about it here http://world.episerver.com/Documentation/Items/Tech-Notes/EPiServer-CMS-6/EPiServer-CMS-6-R2/XForms/ this will circumvent the nestled formtag problem, usually used by editors. Write forms with asp.net controllers is the correct way to go yes.
All right, thanks. Well I didnt do an iframe but almost, same principle, just a new window, a static html page. Ok, I think I start a new thread in the future if I want to do another form then, or maybe read up on it.
But I now know I cant nest form tags, so its good to get that confirmed.
Thank you both. Sorry I didnt have time to give you a link Frederik. Here at work I had things on a development server not public, and at home I run localhost throught Visual Studio only.
Hi!
Is it "ok" to use an html form tag in an aspx file? I get strange resaults in IE8. I cant understand what it is.