There are 2 pieces of the control puzzle. On the server side codebehind (.aspx.cs) is the code you write. The corresponding .aspx
file has controls marked with runat=server
to indicate which controls need to have server side support. The name
attribute (IIRC, id
property otherwise) is the name that will be used on the client and server side. To hook the 2 pieces up the designer needs to generate a backing field that has the same name
and type that the .aspx
page is looking for. Therefore it generates the field in an .aspx.designer.cs
file and creates it during construction of the form. If you aren't using a designer then the field would be defined and created inside the codebehind file.
If you symbolically rename the field then it should rename in all places except maybe the .aspx
page but you can simply fix the name
attribute. If you renamed the control using the Properties window in the designer then it should fix up all references automatically.
Honestly if it is horribly broken then I would consider going back to your original "bad" PR and compare what files changed. Those are the changes you need to undo. The commit history will have the value(s) that were used before your change so make sure you line them up.