Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Renaming aspx files 1

Status
Not open for further replies.

Blueie

Technical User
May 12, 2012
72
GB
Hello

I have a number of aspx files that I use only for testing and some of these aspx files have a variety of different names. For example, I have 'thank you' aspx files - to thank users for registering - called thank_you_copy1.aspx and thank_you_copy2.aspx.

At some point, I will compile them to test on a Web hosting service's server, and when the site(s) go live with a proper name, I will need to rename these Web pages in favour of more formal/respectable names.

Is it best to compile them, upload them to the server, test them, and then rename them on the server - as in right-click | Rename - or is it best to rename them in Visual Studio (VS) and then do all the server stuff? And if I rename them in VS do I just do the same - right-click on each aspx file | Rename - or do I start with clean files that contain working code?

Thanks.

 
If you rename the files after you move them to the hosting server, you are going to throw errors because your code will be looking for the original name.
Rename your files in VS.
 
Many thanks for that jbenson - very useful information.

Regards
 
Would you advise simply renaming the project and pages I have, or beginning with clean pages with 'proper' name and pasting my code uploading images, etc, into those clean pages?

Thanks for your time.
 
You can rename, that is no problem. But remember, changing the name of the aspx file will not change the partial class name in the code behind. This won't cause any issues
but may seem weird when you go back and look at the code later.
 
I see what you mean.

I suppose I should begin any new project with proper names - I think I have learnt that over the last day or so.

Thank you again.
 
You don't need to do that, you can rename the partial class name to the page name or whatever you want, as long as you also change the reference to it in the aspx page
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top