In a datalist your controls display claiming there are duplicates
-
I'm really sorry for having to ask this, and I have tried searching for the answer but it doesn't seem to be forthcoming. I have an ASP.NET page with a DataList derived control on it. (The control adds some extra javcript, and a few other gubbins, of no particular importance.) The data list has an ItemTemplate and a EditItemTemplate in it, both with a large number of controls. The problem I'm having is that the editor insists that all the controls are duplicates, that there is already a control with that name on the page somewhere. Except I've searched and can't find duplicate id's for any of them. (Okay, I lie slightly, I searched for about twenty randomly picked controls, as there are a *huge* amount of controls in both templates.) To try to resolve this I've swapped the datalist control back to the standard data list, and this didn't have any effect. (I didn't expect it to, as I use the derive DataList on around 30-odd other pages fine.) I also did a massiv renaming exercise, which was interesting. Here's the steps I took: 1) Do a search for id=" replacing with id="temp. 2) Do a search for id= replacing with id=temp 3) Do a search for id=temp"temp replacing with id= I then switched back to HTML mode, went to edit templates, and all of controls were properly drawn, no complaining about duplicates. Has anyone seen this behaviour before, and if so how did you solve it? Thanks, Steve Update After much headscratching I noticed that in the codebehind file for the page all of the erroring controls were declared as protected members, which after checking other pages with DataLists on I determined was incorrect. :doh: So I took all of the incorrect declarations out, and the page can now be editted in the editor! :cool:
-
I'm really sorry for having to ask this, and I have tried searching for the answer but it doesn't seem to be forthcoming. I have an ASP.NET page with a DataList derived control on it. (The control adds some extra javcript, and a few other gubbins, of no particular importance.) The data list has an ItemTemplate and a EditItemTemplate in it, both with a large number of controls. The problem I'm having is that the editor insists that all the controls are duplicates, that there is already a control with that name on the page somewhere. Except I've searched and can't find duplicate id's for any of them. (Okay, I lie slightly, I searched for about twenty randomly picked controls, as there are a *huge* amount of controls in both templates.) To try to resolve this I've swapped the datalist control back to the standard data list, and this didn't have any effect. (I didn't expect it to, as I use the derive DataList on around 30-odd other pages fine.) I also did a massiv renaming exercise, which was interesting. Here's the steps I took: 1) Do a search for id=" replacing with id="temp. 2) Do a search for id= replacing with id=temp 3) Do a search for id=temp"temp replacing with id= I then switched back to HTML mode, went to edit templates, and all of controls were properly drawn, no complaining about duplicates. Has anyone seen this behaviour before, and if so how did you solve it? Thanks, Steve Update After much headscratching I noticed that in the codebehind file for the page all of the erroring controls were declared as protected members, which after checking other pages with DataLists on I determined was incorrect. :doh: So I took all of the incorrect declarations out, and the page can now be editted in the editor! :cool: