Skip to main content
CSharpUniversity ASP.NET and C# lessons

The search runs entirely in your browser over the published lesson list.

Moving files between two projects

Copying a page between projects looks trivial and often breaks. The reason is that a page is more than one file.

What actually needs to travel

  • The page markup file.
  • Its code behind file, if it has one.
  • Any image or stylesheet the page uses.
  • Any configuration entry the page depends on.

The safe order

  1. Add the new page inside the target project using the editor, so it is registered.
  2. Copy the markup and the code behind into the new files.
  3. Copy the assets, then fix any paths that were relative to the old project.
  4. Build and run the target project before you delete anything from the source.
Watch the paths. Most broken copies are broken because an image or stylesheet was still pointing at a folder that only exists in the old project.

When a page is moved and renamed, renaming with the refactor tool keeps every reference consistent.

New lessons by email

Leave your address and get a short note whenever a fresh lesson is published. No account needed and you can stop at any time.

Thank you. Your address has been noted in this browser session. Connect a mailing service to deliver the notes for real.