When you copy a big chunk of ASP.NET code the chances are you are going to run int IDs problem. IDs from the new code is wiped as soon as you past them. Here is a solution to fix it.
Copy the chuck of code into clipboard and past into “Sublime Text 2” for example. Use the following RegPater to call all IDs.
RegEx pattern to get all IDS = (id=".*?)(")
Use the following patter in the replace text
Replace String: $1_2$2
Make sure you have select “Regular Expression” (there is a short cut button for it).
Replace everything it finds. And the copy and past the new code. This should fix the problem.
If your code has control validator, use the following regex as a second run to fix that issues
RegEx: (ControlToValidate=".*?)(") Repalce String: $1_2$2
Please note, do not leave – character in ID as Visual Studio will automatically wipe that out.