Master Pages and changing ID of form tag [duplicate]
Possible Duplicate:
ASP.NET Form - The form name\id changes to aspnetForm
I'm using Framework V4.0, I used a master page, and a content page.
I put my FORM tag in master page, and I set id of FORM tag to something like "form1" but when I view source of rendered page, I saw that ASP.NET changed id of FORM tag to "aspnetForm"
.
I mean I have this tag in master page file :
<form id="form1" runat="server">
but after page is rendered, ASP.NET Changed it to :
<form method="post" action="Default.aspx" id="aspnetForm">
as you see id attribute of Form tag is changed. What is r开发者_JS百科eason of behind this?
I don't know the exact reason but when we use master pages the id's of the controls on the content pages changed.
For example. if content page contains a control
after rendering it's ID will become ContentplaceholderID_LabelID
to avoid it set clientID mode property of the control to static.
精彩评论