|
-
Nov 13th, 2010, 05:13 AM
#1
Re: UserControl javascript: get control by id
But look at the HTML I posted a few posts back. The labels do have unique IDs. The first one is called ctl00_MainContent_ctl00_label, and this is also what it says in the first javascript code. The second one is called ctl00_MainContent_ctl01_label and that's also what it says in the second javascript code.
And from MSDN:
The default value of ClientIDMode for a page is Predictable. The default value of ClientIDMode for a control is Inherit. Because the default for controls is Inherit, the default generation mode is Predictable. (However, if you use Visual Studio to convert a Web project to ASP.NET 4 from an earlier version, Visual Studio automatically sets the site default to AutoID in the Web.config file.)
As far as I know I didn't convert my project, I just started a new Web Application in ASP.NET 4, so my default ClientIDMode should be Predictable.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|