I've been tasked to upgrade an old VB web app to VS2008/.Net and for the most part this has worked well, however;

On one page, among other stuff, I have a number of buttons and a databound datagrid. The first column in the grid contains an option button and two hidden controls. The option buttons determine what buttons on the form are enabled or disabled. The first hidden control holds a numeric value from the database that matches the text value in one of the datagrid fields (Status). eg, if the status is 'OK', the hidden value would be 10 for example, the javascript code (GetElementById) deals with this and makes the 'Menu' button enabled.
My problem is that the ClientId for the controls within the datagrid are for the most part rendered in the format;
dgAssessment_ctl01_hiddenStatus, this is the case for my dev environment WS2008/VS2008/IE9, on a test box W7/64Bit/IE10 (CompatibilityMode) but when the site is installed on my clients web server, WS2008R2/IE10, the ClientId is rendered as
dgAssessment_hiddenStatus_0 and obviously, the javascript code, pre-written, is not finding the control.

I've tried compatibility mode for this site too.

Is there a way to ensure that the ClientId for each control within the datagrid maintains consistency across browsers/servers? Any help appreciated.