Best way to copy a web form page within a project?
So let's say you wanted to make a copy of a web form page in a .NET project.
Is there an easier way:
- Copy source page
- Page source page inside project to get new page
- Exclude source page
- Rename code by class for new page
- Add original page Back
Sometimes I am missing something obvious, is there a better way to do this? I know the next question is, "Why are you copying the code inside the project and not reusing it?" Let's just say it's a secret;).
+1
source to share
3 answers
I'm doing it:
- Select the original ASPX file in the solution explorer
- Ctrl + C followed by Ctrl + V (quick copy)
- Rename the new ASPX file (say NewFile.aspx)
- Rename the code class name to NewFile
- Rename the
Inherits
directive attributePage
to HTML for completion with "NewFile" - (Optional) If you moved the page to a different folder, you will need to update the namespace references in the HTML directive
Page
as well as in the code.
+3
source to share