subfolders in asp.net projects

E

epigram

We've got an existing asp.net project (using visual studio 2003) and have
several aspx pages in the project. We've decided that there are going to be
a lot of related aspx pages that we'd like to have in a subfolder for
organizational reasons. So, I created the new folder in the project and
"dragged" the aspx file (along with the cs and resx files) into this new
folder. Since the project was under source control VS warned me about doing
this and something to the effect of the solution wouldn't remember these
files. I'm now faced with two questions/issues:

1) I'm hoping that I can deal with the SourceSafe issues by simply creating
a subfolder/project in SS and adding the files that are now in that folder
(on my local system) to that project. I am assuming that the VS asp.net
project does understand where these files exist in SS after this, but I'm
not sure. Bottom line is, what do I need to do to properly deal with the
folder creation scenario I just described.

2) Now that I have the files in the subfolder in VS, when I run the project
I'm getting URL problems. For example, I do a redirect in my custom base
page (the page that all my cs files inherit from - it inherits from the Page
class) and the redirect now doesn't work because, of course, the web server
is trying to find the aspx file (that I'm trying to redirect to) in the
subfolder. I tried adding a forward slash thinking that would fix it by
having the web server search from the root to find the correct file, but
that didn't work. Any ideas on how to deal with this situation.

I've read previously that it is a good idea to keep everything in one folder
for an asp.net app. If that is the case, I'll gladly undo everything. It
appears this could turn out to be more trouble than it is worth. Any help
would be much appreciated.

Thanks!
 
C

Craig Deelsnyder

epigram said:
We've got an existing asp.net project (using visual studio 2003) and have
several aspx pages in the project. We've decided that there are going to be
a lot of related aspx pages that we'd like to have in a subfolder for
organizational reasons. So, I created the new folder in the project and
"dragged" the aspx file (along with the cs and resx files) into this new
folder. Since the project was under source control VS warned me about doing
this and something to the effect of the solution wouldn't remember these
files. I'm now faced with two questions/issues:

1) I'm hoping that I can deal with the SourceSafe issues by simply creating
a subfolder/project in SS and adding the files that are now in that folder
(on my local system) to that project. I am assuming that the VS asp.net
project does understand where these files exist in SS after this, but I'm
not sure. Bottom line is, what do I need to do to properly deal with the
folder creation scenario I just described.

2) Now that I have the files in the subfolder in VS, when I run the project
I'm getting URL problems. For example, I do a redirect in my custom base
page (the page that all my cs files inherit from - it inherits from the Page
class) and the redirect now doesn't work because, of course, the web server
is trying to find the aspx file (that I'm trying to redirect to) in the
subfolder. I tried adding a forward slash thinking that would fix it by
having the web server search from the root to find the correct file, but
that didn't work. Any ideas on how to deal with this situation.

I've read previously that it is a good idea to keep everything in one folder
for an asp.net app. If that is the case, I'll gladly undo everything. It
appears this could turn out to be more trouble than it is worth. Any help
would be much appreciated.

Thanks!
Keeping everything in one folder is not necessarily a good design at
all, nor is it a bad one; it's all preference and how big your app is.

When you move the files, essentially all it is saying is that 'VSS is
not going to delete the files in the old location; and you will lose all
history, etc.', if I remember right. After you checkin after this
warning, you'll notice VSS will have created the new folder, and put the
files in there. But if you go back to your root folder in VSS for your
app, you'll notice the copies are still there as well, and possibly
checked out to you. One option is just delete the old files in the old
location in VSS.

Now, remember, you do lose all history if I remember correctly in those
files, as you (er, VS.NET) essentially created a new set of files which
happened to be a copy of the one in the original location. You could
try, after checking in as noted above, go into VSS, delete the files in
the new subdirectory, and then Move the old ones to the new location in
VSS. When done, VS.NET doesn't care, it just looks in whatever file/VSS
locations it has in its file mappings; do a get latest after all this to
verify.

BTW, VS 2005 cleans this process up immensely...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top