Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Master page and nested forms issue

Tags:

I have got master page with form (runat="server"). However in nested page, I have 2 forms. First is for changing password and second one is for submiting user data... Both must exist, with separate submit buttons.

I tried to enclose appropriate fields with form tags, but I got an error that enclosed forms are not allowed.... How can I achieve my goal?

Thanks!

like image 690
dragonfly Avatar asked Aug 28 '09 11:08

dragonfly


People also ask

Can master pages be nested?

Master pages can be nested, with one master page referencing another as its master. Nested master pages allow you to create componentized master pages. For example, a large site might contain an overall master page that defines the look of the site.

Are nested forms valid HTML?

Flow content, but with no form element descendants. "Content model" means "what this element may contain". So no, nested forms are not allowed.

Can you have nested forms?

Every form must be enclosed within a FORM element. There can be several forms in a single document, but the FORM element can't be nested.

How can I use multiple master pages in asp net?

aspx. If you want a Master Page, you can add the page (Web Forms MasterPage) Add+New item (Ctrl+Shift+A). Now,we can add the first Master Page in our Solution Explorer. Now, we can add some web forms.


2 Answers

ASP.NET supports a single form per page only (it emulates desktop sessionful forms). Probably what you need is to leave the form in the master page and to have 2 Click handlers for the buttons on the content page. You may also need to specify ValidationGroup for your controls and buttons so that they don't interfere if you have some validators.

like image 104
UserControl Avatar answered Oct 02 '22 23:10

UserControl


As you have already form in master page, you will not be able to add any form in the nested page, there could be only one form tag per page,

rather than creating two different forms in nested page, cant you create separate two different div, table etc

what force you to take form in nested page

like image 34
Md. Parvez Alam Avatar answered Oct 02 '22 23:10

Md. Parvez Alam