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!
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.
Flow content, but with no form element descendants. "Content model" means "what this element may contain". So no, nested forms are not allowed.
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With