ASP.NET files usually consist of 1-3 files depending on the type of project and the file itself. In this case, there is always a * .aspx markup file, and then, possibly, there will be a file with the code ".aspx.cs" and an additional, as well as an additional * .aspx.designer.cs constructor file. If you rename a file, you need to update the code in different places based on the structure of the file itself.
If you create more than one file that makes up your ASP.NET page, you will want to update the header of the .aspx file as follows:
<%@Page CodeBehind="XYZ.aspx.cs" Inherits="XYZ" %>
to
<%@Page CodeBehind="ABC.aspx.cs" Inherits="ABC" %>
Then in the code behind the file
public partial class XYZ : Page { }
to
public partial class ABC : Page { }
Finally, if there is a * .designer.cs file, you will also want to update it:
public partial class XYZ : Page { }
to
public partial class ABC : Page { }
This should cover all files!
source share