Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form and Site.Master Conflict
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Form and Site.Master Conflict
Environment versions
Environment:
VB 9.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01597264
Message ID:
01597264
Views:
53
Hi,
I am trying to understand how to get around the following "issue":

The ASP.NET Forms project has a Site.Master page which is used in all other pages. The Site.Master page has the "Form" element within the entire Body. And I need the individual pages (that use the Site.Master) to have a "Form" element too where I would set the class "form-horizontal" (for Bootstrap 3) as following:
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">

     <form class="form-horizontal" id="form1" runat="server">
     
    </form>

</asp:Content>
But the above "Form" element has the squiggly green line underneath and the message VS 2012 displays is:
 "Validation (HTML5). Element 'form' must not be nested within element 'form'"   
So my question is, how can I have element "form" in the Site.Master page and in the content page that uses the Master page? Or should I do away with element "form" in the Site.Master?

TIA

UPDATE: Let me rephrase the question as following. Since I cannot have the "form" tag in the Master and a Content page, what if I just add the class="form-horizontal" to the Master page "form" element. I think that the content pages that need this class will be "happy." But what type of Content page could be "messed up" by the class="form-horizontal"?

UPDATE 2: I just thought about another approach. What if I add jQuery to the pages that need the class="form-horizontal" to add the class "form-horizontal" to the "form" element? (using jQuery .AddClass). This way, the content pages that do not need the class "form-horizontal" will not have it and the ones that do will. Does it make sense?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Next
Reply
Map
View

Click here to load this message in the networking platform