0

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 reason of behind this?

Community
  • 1
  • 1
Pankaj Agarwal
  • 11,191
  • 12
  • 43
  • 59

1 Answers1

1

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.

Waqar Janjua
  • 6,113
  • 2
  • 26
  • 36