Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to put controls within different content placeholder without using form
    text
    copied!<p>Situation: I have a master page which has 3 content place holder but no form runat server. In my Login.aspx I try to fill those place holders but it does't allow me without form runat server tag and once I add more than one form again it shows me :"A page can have only one server-side Form tag."</p> <p>here is my code :</p> <pre><code> &lt;%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="DWDS_Lotus_Care_Final.Page" %&gt; &lt;asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="server"&gt; &lt;form id="formUser" runat="server"&gt; &lt;p&gt; &lt;asp:Label ID="lblUsername" runat="server" Text="Username"&gt;&lt;/asp:Label&gt; &lt;asp:Button ID="btnLogout" runat="server" Text="Logout" /&gt; &lt;/p&gt; &lt;/form&gt; &lt;/asp:Content&gt; &lt;asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"&gt; &lt;form id="form1" runat="server"&gt; &lt;table style="width: 100%"&gt; &lt;tr&gt; &lt;td style="width: 93px"&gt; UserName : &lt;/td&gt; &lt;td style="width: 139px"&gt; &lt;asp:TextBox ID="txtUserName" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;/td&gt; &lt;td style="width: 307px"&gt; &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txtUserName" runat="server" ErrorMessage="*"&gt;&lt;/asp:RequiredFieldValidator&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style="width: 93px"&gt; Password :&lt;/td&gt; &lt;td style="width: 139px"&gt; &lt;asp:TextBox ID="txtPassword" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;/td&gt; &lt;td style="width: 307px"&gt; &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtPassword" runat="server" ErrorMessage="*"&gt;&lt;/asp:RequiredFieldValidator&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style="width: 93px"&gt; &amp;nbsp;&lt;/td&gt; &lt;td style="width: 139px"&gt; &lt;asp:Button ID="btnSubmit" Text="Submit" runat="server" onclick="btnSubmit_Click" /&gt; &amp;nbsp;&amp;nbsp; &lt;asp:Button ID="btnClear" Text="Clear" runat="server" onclick="btnClear_Click" /&gt; &lt;/td&gt; &lt;td style="width: 307px"&gt; &lt;asp:LinkButton ID="linkRegister" Text="Register" runat="server"&gt;&lt;/asp:LinkButton&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/p&gt; &lt;/form&gt; &lt;/asp:Content&gt; &lt;asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder3" runat="server"&gt; &lt;/asp:Content&gt; </code></pre> <p><strong>here is the master source</strong></p> <pre><code>&lt;%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="DWDS_Lotus_Care_Final.Site1" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt; &lt;meta name="description" content="" /&gt; &lt;meta name="keywords" content="" /&gt; &lt;title&gt;Consistent&lt;/title&gt; &lt;link href="http://fonts.googleapis.com/css?family=Bitter" rel="stylesheet" type="text/css" /&gt; &lt;link rel="stylesheet" type="text/css" href="style.css" /&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="wrapper"&gt; &lt;div id="header"&gt; &lt;div id="logo"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="menu"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;Login&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;About&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Portfolio&lt;/a&gt;&lt;/li&gt; &lt;li class="last"&gt;&lt;a href="#"&gt;Contact&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div id="page"&gt; &lt;%--Here is the sidebar--%&gt; &lt;div id="sidebar" style="background-color:#CCCCCC"&gt; &lt;asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server"&gt; &lt;/asp:ContentPlaceHolder&gt; &lt;h3&gt;Links to Other Hospitals&lt;/h3&gt; &lt;div class="date-list"&gt; &lt;ul class="list date-list"&gt; &lt;li class="first"&gt;&lt;span class="date"&gt;Sunway&lt;/span&gt; &lt;a href="#"&gt;Sunway Piramid&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;span class="date"&gt;KPJ&lt;/span&gt; &lt;a href="#"&gt;Kajang Care Centre&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;span class="date"&gt;HCC&lt;/span&gt; &lt;a href="#"&gt;Health Care Center&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;span class="date"&gt;AlphaH&lt;/span&gt; &lt;a href="#"&gt;Alpha Health Center&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;span class="date"&gt;UPC&lt;/span&gt; &lt;a href="#"&gt;Bangsar Hospital&lt;/a&gt;&lt;/li&gt; &lt;li class="last"&gt;&lt;span class="date"&gt;TPM&lt;/span&gt; &lt;a href="#"&gt;Technology Park Hospital&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;br class="clearfix" /&gt; &lt;/div&gt; &lt;%--Here is the Content--%&gt; &lt;div id="content"&gt; &lt;h2&gt;Welcome to Lotus Care&lt;/h2&gt; &lt;div class="box"&gt; &lt;asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"&gt; &lt;/asp:ContentPlaceHolder&gt; &lt;/div&gt; &lt;div class="box"&gt; &lt;asp:ContentPlaceHolder ID="ContentPlaceHolder3" runat="server"&gt; &lt;/asp:ContentPlaceHolder&gt; &lt;/div&gt; &lt;br class="clearfix" /&gt; &lt;/div&gt; &lt;br class="clearfix" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="footer"&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload