Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / April 2008

Tip: Looking for answers? Try searching our database.

Multiple controls with the same ID

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kwongtk - 25 Apr 2008 11:30 GMT
error message found in server A
"Multiple controls with the same ID 'batchEndorseworklist' were found. Trace
requires that controls have unique IDs."

but in server B is normal

why?
thank you
clintonG - 25 Apr 2008 15:23 GMT
Oddly enough, I've recently discovered multiple instances of the same
control with the same ID can be used in a Wizard control when each
respective instance of the control exists in one or more of the Wizard's
templates. I also note this occurs when the Wizard control is used in a
content page referenced by a MasterPage ContentPlaceHolder which requires
its own respective unique ID.

> error message found in server A
> "Multiple controls with the same ID 'batchEndorseworklist' were found.
[quoted text clipped - 5 lines]
> why?
> thank you
kwongtk - 28 Apr 2008 09:39 GMT
Normal:
http://i170.photobucket.com/albums/u258/kwongtkd/kwongtk2.jpg
Error:
http://i170.photobucket.com/albums/u258/kwongtkd/kwongtk1.jpg

if i change
this.ID = "batchEndorseworklist";
to
this.ID = "batchEndorseworklist1";
everything will be ok. but i  can't call the javascript
var CheckArray =  parent.Worklist.batchEndorseworklist.checkbox
if(CheckArray != null)

> Oddly enough, I've recently discovered multiple instances of the same
> control with the same ID can be used in a Wizard control when each
[quoted text clipped - 12 lines]
> > why?
> > thank you
clintonG - 28 Apr 2008 17:26 GMT
Well --maybe-- go with the flow then and don't fight the compiler. So why
not just rewrite your JavaScript/

// for example
var CheckArray   =  parent.Worklist.batchEndorseworklist.checkbox
var CheckArray1 =  parent.Worklist.batchEndorseworklist1.checkbox

if(CheckArray != null || CheckArray1 != null)

Ordinarily the compiler does not allow multiple instances of controls of the
same type with the same ID. I have learned this "rule" does not apply when
using Master Pages and the Wizard control and that's about all I can help
with other than to suggest what I said about modifying the JavaScript

> Normal:
> http://i170.photobucket.com/albums/u258/kwongtkd/kwongtk2.jpg
[quoted text clipped - 25 lines]
>> > why?
>> > thank you

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.