I am trying to color text boxes in a form and I get below error when run web page...
"A page can have only one server-side Form tag.
Exception Details: System.Web.HttpException: A page can have only one server-side Form tag."
my code behind:
foreach (Control c in frmBillingandShipping.Controls)
{
if (c.GetType() == typeof(TextBox))
{
TextBox t = (TextBox)c;
t.BackColor = System.Drawing.Color.AliceBlue;
t.ReadOnly = false;
}
}
my aspx page (top portion):
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="BillingandShipping.aspx.cs" Inherits="Gzk2012.ShoppingCart.BillingandShipping" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%--<form id="frmBillingandShipping" method="post" runat="server">--%>
...
</form>
</asp:Content>
I understand the master page has a form tag, how to get around this?
Thanks
"A page can have only one server-side Form tag.
Exception Details: System.Web.HttpException: A page can have only one server-side Form tag."
my code behind:
foreach (Control c in frmBillingandShipping.Controls)
{
if (c.GetType() == typeof(TextBox))
{
TextBox t = (TextBox)c;
t.BackColor = System.Drawing.Color.AliceBlue;
t.ReadOnly = false;
}
}
my aspx page (top portion):
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="BillingandShipping.aspx.cs" Inherits="Gzk2012.ShoppingCart.BillingandShipping" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%--<form id="frmBillingandShipping" method="post" runat="server">--%>
...
</form>
</asp:Content>
I understand the master page has a form tag, how to get around this?
Thanks