I found out that I could set the name attribute to be equal to the id using javascript in the browser. This can be done easily with jquery, but if you do not use jquery, then another option is to iterate through input elements, and other elements which are possible to post back.
I think the only drawback is that you have to make sure that you only change the dynamically created controls, and not hit any runat="server" ASP controls, since those use the name attribute to assign their values to.
The following code is the javascript I use:
function SetControlNamesToId() {
var inputObjects = document.getElementsByTagName('input');
for (i = 0; i < inputObjects.length; i++) {
if (inputObjects[i].type == 'checkbox' ||
inputObjects[i].type == 'radio' ||
inputObjects[i].type == 'text' ||
inputObjects[i].type == 'hidden') {
SetNameToId(inputObjects[i]);
}
}
var selectObjects = document.getElementsByTagName('select');
for (i = 0; i < selectObjects.length; i++) {
SetNameToId(selectObjects[i]);
}
var textAreaObjects = document.getElementsByTagName('textarea');
for (i = 0; i < textAreaObjects.length; i++) {
SetNameToId(textAreaObjects[i]);
}
}
function SetNameToId(control)
{
if (control.id && control.id != "") {
control.setAttribute("name", control.id);
}
}