I'm using asp.net/vb.net 4.0, visual studio 2010, and the linq-to-entities model with dynamic data scaffolding to give users generated forms to edit data in a SQL database.
I have added some buttons that call javascript functions to the insert.aspx in the PageTemplates folder.
At first I was using something like
var account = document.getElementById("ctl00_ContentPlaceHolder1_FormView1_ctl04_ctl00___account_TextBox1");
to access the elements by whatever random ID asp.net chose to generate.
The problem is that whenever a new data field is added to the SQL db, asp.net changes the random IDs for all the other elements to fit the new one in. I would resolve this as per this question; but because the fields are generated, there are no asp.net objects to call .ClientID on.
Is there a solution to this?