.NET /asp.net 4: Changes with automatic NAMES of controls?
Posted
by mark smith
on Stack Overflow
See other posts from Stack Overflow
or by mark smith
Published on 2010-04-13T13:14:50Z
Indexed on
2010/04/13
13:23 UTC
Read the original article
Hit count: 344
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
© Stack Overflow or respective owner