INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Renaming aspx files

Renaming aspx files

(OP)
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.

RE: Renaming aspx files

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.

RE: Renaming aspx files

(OP)
Many thanks for that jbenson - very useful information.

Regards

RE: Renaming aspx files

Glad to help

RE: Renaming aspx files

(OP)
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.

RE: Renaming aspx files

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.

RE: Renaming aspx files

(OP)
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.

RE: Renaming aspx files

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close