How are .NET control IDs assigned for controls? (_ctl0_...)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Are control IDs dynamically assigned each time a page loads for .NET
controls? So, if there's a text box which has been assigned the ID
"_ctl0_txtName" and I refer to that name in javascript, might the ID change
at some point in the future to something like "_ctl5_txtName"making the
script invalid?
 
It may change in future. Use the ClientID property instead.

Are control IDs dynamically assigned each time a page loads for .NET
controls? So, if there's a text box which has been assigned the ID
"_ctl0_txtName" and I refer to that name in javascript, might the ID change
at some point in the future to something like "_ctl5_txtName"making the
script invalid?
 
Back
Top