Home Page

UPDATE: 2010 Developer Action Plan The folks at LearnVisualStudio.NET have created a new Developer Action Plan packed with strategies and advice to help you get that elusive first .NET development job and also become an awesome ASP.NET developer. This action plan is perfect:

  • For those with little or no .NET experience, or...
  • For those with programming experience, but who feel like their skills are deteriorating or becoming stale

If you simply enter your email in the next 15 minutes, you will get:

  • A download link for the 2010 Developer Action Plan
  • 4 hours of free ASP.NET training videos you can watch from the comfort of your computer
==> Click HERE to get your gifts immediately. It's safe and easy. <==


When you are coding in C#, there may be many times where you give a name to a class or a method and you decide later that you want to change that name.  This is especially true for objects that have a default name like the “_Default” class that is autogenerated for the Default.aspx web form when you create a brand new web site in Visual Web Developer.  In this lesson I will cover an easy way to rename a class or a method and have the Visual Web Developer IDE handle changing the name throughout the entire program automatically for me.

In order to rename a class and have the IDE change all the code in the program that references the old name to refer to the new name, I can use the refactor feature.  It is very easy to use and is accessible by right clicking over the object that you want to rename.  When you right click over a class name for example, you then choose Refactor->Rename.  A rename popup dialog box will appear.  Type in the new name for the class and click “Preview reference changes”.  Preview is a good idea because it will give you an idea of how many lines of code in your program the IDE will automatically update for you with the new name of the class.  Click OK and the Preview Changes window will appear showing you all the places that will be changed in the program.  Click Apply to perform the refactoring.  You can use this feature with method names and variable names as well. 

It is important to use this refactor feature rather than just change the name of the objects manually yourself, because if you make manual changes, you may not realize how many places in your program are referencing the object being renamed.  Click here to see an example video where I change the name of a class using the refactor feature of Visual Web Developer.

No Comments »

No comments yet.

RSS feed for comments on this post.

Leave a comment