.NET /asp.net 4: Changes with automatic NAMES of controls?
- by mark smith
Hi there,
I just updated an app from .net 2.0 to .net 4.0 and i have noticed the following...
For example i have the following control..
<input type="hidden" name="ctl00$cphMain$hfdFueraHorarioOficinaConfirmado"
id="cphMain_hfdFueraHorarioOficinaConfirmado" value="False" />
and then in javascript i did this before..
var hfdFueraHorarioOficinaConfirmado=document.getElementById('ctl00_cphMain_hfdFueraHorarioOficinaConfirmado');
but after checking the Id within the html source once it renders and also doing some debugging with firebug etc....
it has changed from
ctl00_cphMain_hfdFueraHorarioOficinaConfirmado
to
cphMain_hfdFueraHorarioOficinaConfirmado
can anyone explain why? .... so should i basically do a search and replace and remove the ctl00??????
A little confused
Obviosuly the javascript line with the the ctl00_ infront return NULL because it doesn't exist, but removing this returns the object..
Any help or ideas really appreciated
Thanks