Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Moving aspx files to a subdirectory


Message #1 by "Matt Dittman" <mddittman@h...> on Tue, 16 Jul 2002 20:02:11
I need some help with this... I am adding on to my web application and 
need to reorganize my aspx files.  I would like to move some of them into 
a subdirectory to keep them better organized.  I created the new directory 
and moved the files using visual studio.  In the first line of the aspx 
page, I changed the Inherits attribute for the codebehind like this:

Inherits="MyApp.allHome"  
to  
Inherits="MyApp.NewFolder.allHome"

I also changed the namespace in the codebehind from:

namespace MyApp  
to  
namespace MyApp.NewFolder

After this, I did a rebuild of the project, then of the solution but I 
keep getting the error "Could not load type MyApp.NewFolder.allHome' when 
I browse to allHome.aspx.  What do I need to do to move files among 
directories?  Do I need to change web.config, or global.asax?  I'm sure 
I'm just missing something simple...

Thanks in advance,

Matt
Message #2 by "Mingkun Goh" <mangokun@h...> on Wed, 17 Jul 2002 11:38:28
Inherits="MyApp.allHome" refers the the namespace your allhome class is 
in, not the physical directory path.

So you dun have to change anything at all.

Pls remove .NewFolder and rebuild your solution and everything should be 
fine.

Hope it helps.


> I need some help with this... I am adding on to my web application and 
n> eed to reorganize my aspx files.  I would like to move some of them 
into 
a>  subdirectory to keep them better organized.  I created the new 
directory 
a> nd moved the files using visual studio.  In the first line of the aspx 
p> age, I changed the Inherits attribute for the codebehind like this:

> Inherits="MyApp.allHome"  
t> o  
I> nherits="MyApp.NewFolder.allHome"

> I also changed the namespace in the codebehind from:

> namespace MyApp  
t> o  
n> amespace MyApp.NewFolder

> After this, I did a rebuild of the project, then of the solution but I 
k> eep getting the error "Could not load type MyApp.NewFolder.allHome' 
when 
I>  browse to allHome.aspx.  What do I need to do to move files among 
d> irectories?  Do I need to change web.config, or global.asax?  I'm sure 
I> 'm just missing something simple...

> Thanks in advance,

> Matt
Message #3 by "Matt Dittman" <mddittman@h...> on Wed, 17 Jul 2002 12:46:57
I removed the new directory name from the "Inherits" attribute and 
rebuilt, but it still doesn't work.  When I add a new webform to the new 
subdirectory, it adds the new folder name in the same places as I did, so 
I believe my changes should be correct...

Any ideas????

Thanks...
Message #4 by "Matt Dittman" <mddittman@h...> on Wed, 17 Jul 2002 12:59:49
Actually, I think I just found my PROBLEM... but not the solution to it.

A while ago, while I was just starting the app, I had another VS Project 
under this solution named "MyApp", but I removed it. Now that I've added a 
folder with the same name, it seems to be giving me problems.  It seems 
like VS is getting a simple subdirectory confused with another web 
application that no longer exists.  Do I need to rebuild my 
solution/project?

  Return to Index