Background: The database that I'm working from is a database that contains geographic layers. For simplicity, it is best to think of these as images. Each layer has many attributes (name, abbreviation, owner, size, etc.) Each layer belongs to a certain group. In the layer table of the database group is a foreign key to the group table. Each group has a name, location, contact, website.
I have a formview. In the EditTemplate of the formview there is a table, with a row for each of the attributes of the layer. For the Group row of the table, there is a label with the current groups name, and a link button that allows the user to change the group. There's an updatePanel with a div inside of it, that allows the user to select a group from a databound dropdownlist, or add a new group. If the user chooses to add a new group, a table becomes visible that allows them to add a new group with name location, contact, and website. Once they submit that, it sets the label to that group. Then the user clicks update and the record is updated in the database.
That all works.
The problem is the InsertTemplate. For the insert template, I copied the editTemplate and got rid of all of the databindings. The only problem im having is with that updatePanel. The problem occurs because the page already has controls with those IDs. I do not wish to rename everything for the InsertItemTemplate, because then I have to make a copy of all the code associated with it.
I've thought about moving the updatePanel outside of the formview and then putting a placeholder in both templates, but I can't seem to get this to work. Aside from that, does anyone have a good solution? (or know how to actually use a placeholder in conjuction with an updatePanel)
I'm not going to post my code (2000 lines with the codebehind) but I can email it out if someone really wants to look at it.
Any help is very much appreciated, I've been trying to figure this out for about 3 days now. Thanks!