A
Abraham Luna
i have a master page with this code in it:
<%@ Master %>
<html>
<head>
<title>Web App</title>
</head>
<body>
<form id="frmMain" runat="server">
<asp:contentplaceholder id="cphMainContent" runat="server">Default
Content</asp:contentplaceholder>
</form>
</body>
</html>
and a content page with this code in it:
<%@ Page Language="C#" MasterPageFile="MasterPage.master" %>
<script language="c#" runat="server">
void Page_Load(Object Sender, EventArgs E)
{
}
</script>
<asp:content id="contentCustomerName" contentplaceholderid="cphMainContent"
runat="server">
<asp:TextBox ID="tbName" runat="server" />
</asp:content>
and this is the rendered html:
<html>
<head>
<title>Web App</title>
</head>
<body>
<form method="post" action="customers.aspx" id="aspnetForm">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwUJNTkyOTExNDAwZGQPvWaSKqwRSSNIY3SFgXih+5aVbg==" />
</div>
<input name="ctl00$cphMainContent$tbName" type="text"
id="ctl00_cphMainContent_tbName" />
</form>
</body>
</html>
my first question is why did the form id get reset to aspnetForm?
and how can i get the rendered input id to be just tbName instead of
ctl00_cphMainContent_tbName
thank you
<%@ Master %>
<html>
<head>
<title>Web App</title>
</head>
<body>
<form id="frmMain" runat="server">
<asp:contentplaceholder id="cphMainContent" runat="server">Default
Content</asp:contentplaceholder>
</form>
</body>
</html>
and a content page with this code in it:
<%@ Page Language="C#" MasterPageFile="MasterPage.master" %>
<script language="c#" runat="server">
void Page_Load(Object Sender, EventArgs E)
{
}
</script>
<asp:content id="contentCustomerName" contentplaceholderid="cphMainContent"
runat="server">
<asp:TextBox ID="tbName" runat="server" />
</asp:content>
and this is the rendered html:
<html>
<head>
<title>Web App</title>
</head>
<body>
<form method="post" action="customers.aspx" id="aspnetForm">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="/wEPDwUJNTkyOTExNDAwZGQPvWaSKqwRSSNIY3SFgXih+5aVbg==" />
</div>
<input name="ctl00$cphMainContent$tbName" type="text"
id="ctl00_cphMainContent_tbName" />
</form>
</body>
</html>
my first question is why did the form id get reset to aspnetForm?
and how can i get the rendered input id to be just tbName instead of
ctl00_cphMainContent_tbName
thank you