ASP.NET Cafe
new tricks every week

DANGER: Copy and paste file inside VS ASP.NET Web Site Problems

Wednesday, 27 February 2008 14:48 by dmitriy

Sometimes we want to take one pair of aspx/aspx.cs files and copy into another.
If you really want to get new page (and the same for User Controls) remember to do the following after you copied page:

  • Check the CodeFile and Inherits attributes of you Page/User Control
  • Rename class inside aspx.cs or ascx.cs
  • Change CodeFile and Inherits to the correct classes

All of this applies to VS 2005. Than does not automatically rename classes if you Copy/Paste files in solution explorer. And sometimes you can feel confused because of this.

IMHO, better not to copy files in solution explorer at all. And if you need to do this, maybe you have conceptual problems?  

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   ASP.NET
Actions: E-mail | del.icio.us | Kick it! | DZone it! | Permalink | Comments (0) | Comment RSSRSS comment feed

Comments

Add comment


 

  Country flag

biuquote
  • Comment
  • Preview
Loading