.Net adding a prefix ctl00_CPHPageContents_ to control IDs

Posted by eFriend on Stack Overflow See other posts from Stack Overflow or by eFriend
Published on 2011-09-14T11:47:13Z Indexed on 2012/11/14 17:01 UTC
Read the original article Hit count: 269

Filed under:
|
|

I have an asp.net C# web forms application in .net framework 4 In my pages, when I view html source it changes control IDs to something like ctl00_CPHPageContents_txtUserID actually it is txtUserID

This application was first in Framework 3.5 and IDs were generated like CPHPageContents_txtUserID

So, in short, in Framework 3.5 Id was CPHPageContents_txtUserID and now in Framework 4 ID is ctl00_CPHPageContents_txtUserID which is breaking our automation tests. Can I remove this ctl00 added by Framework 4?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about .net-4.0