Hi Ravindra,
I've done some more tests. Here are something I found,
First, if I simply create a new folder, say Member, and then add a new web
page, say Default.aspx, it is working fine, no matter if there is another
Default.aspx at the root.
Then, I copied Web.config into /Member. After this, if I try to run
/Member/Default.aspx, an error message says I have to make this folder an
web application in IIS. I did so. But then the old error (can not load
namespace MySite._Default) occurs.
I haven't done many things to Web.config except the following,
<authentication mode="None">
</authentication>
<authorization>
<allow users="*" />
</authorization>
The reason why I add Web.config to that folder is because I want the root
folder be free to access while /Member needs certification. How do people
normally do this in VS.NET?
Thanks,
-Duron
Ravindra said:
Hi Duron,
Actually the concept is : in a single namespace, you can not declare more than one class with same name.
Probably the declaration "Public Class Default" might appears moer than
once in your whole application. In your case I hope you have created
"Default.aspx" more than once (though it appears in different folders in the
same web app).
So the solution can be
1) Change the name of the class in "../Member/Default.asp.vb" file. Say "Public Class MemberDefault".
And accordingly change the @ Page directive as follows:
Inherits = "Mysite.MemberDefault"
2) The other way is decale a separate namespace within the file
"./Member/Default.aspx.vb". Say "Namespace Member". Here you no need to
change the class declaration or name of the class.
And accordingly change @ Page directive as follows :
Inherits = "Mysite.Member.Default"
Here, one important note is, the name of the .aspx file and its class name
may not be the same. It may be diferent.