CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > visual_studio.visual_studio_2005 Tags:
Item Type: Date Entered: 7/19/2007 2:33:49 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 9 Views: 152 Favorited: 0 Favorite
10 Items, 1 Pages 1 |< << Go >> >|
"tempid159" <>
NewsGroup User
App_Code not working properly?7/19/2007 2:33:49 PM

0

I have a VS 2005 website project. I have created a folder in App_code called "BL".

In BL folder, I have a User.cs class. So the structure is, App_Code/BL/User.cs.

Now, I create a new aspx page. In this page, it is not detecting User.cs.. It is showing up .net framework's User(Page.User) class. I thought this might be a conflict of namespaces or something and so I gave a namespace to my User.cs. The namespace given for this class is Sitename.BL.. 

But the namespace(Sitename.BL) doesn't even show up in when I type "Using.. "

If I create another cs in the BL folder, its able to recognize the class. I don;t know where I am going wrong. I don't want to create web application and create a separate BL class library and all for a small website as mine.

Any help is greatly appreciated.

 

"benrick" <>
NewsGroup User
Re: App_Code not working properly?7/19/2007 2:48:01 PM

0

in the solution explorer click on the User.cs class and check in the properties window. It should say that its build action is to compile. 


C. Brendan Enrick
Brendan's ASP.NET Advice Blog

Make sure you click "Mark as Answer" for any post which has helped you. This will give recognition to those helping others as well as earn you a point. It also helps people know which posts still need work.
"tempid159" <>
NewsGroup User
Re: App_Code not working properly?7/19/2007 3:06:21 PM

0

I don't see the usual build action option in the properties window..  

"benrick" <>
NewsGroup User
Re: App_Code not working properly?7/19/2007 3:24:11 PM

0

 Check your access modifiers Make sure that the class is public. If it does not specify then it is defaulted to private and you won't be able to get class not even for static functions. If you plan to instantiate one then you will need to make sure your constructor is also public.


C. Brendan Enrick
Brendan's ASP.NET Advice Blog

Make sure you click "Mark as Answer" for any post which has helped you. This will give recognition to those helping others as well as earn you a point. It also helps people know which posts still need work.
"tempid159" <>
NewsGroup User
Re: App_Code not working properly?7/19/2007 3:55:04 PM

0

Yes, all my classes in the app_code folder are public by default.

This guy has the same problem has mine -

http://www.west-wind.com/wwThreads/Message1QL0ZQ2VA.wwt

"tempid159" <>
NewsGroup User
Re: App_Code not working properly?7/19/2007 3:55:14 PM

0

Yes, all my classes in the app_code folder are public by default.

This guy has the same problem -

http://www.west-wind.com/wwThreads/Message1QL0ZQ2VA.wwt

"benrick" <>
NewsGroup User
Re: App_Code not working properly?7/19/2007 3:57:54 PM

0

 so from within app_code any class can see any other class. But in aspx page code behinds they cannot see the classes in app_code. have you thought of giving your code behind files namespaces also just for kicks. Try accessing the app_code then. Also you might try accessing the page code behind classes from inside of app_code.
 


C. Brendan Enrick
Brendan's ASP.NET Advice Blog

Make sure you click "Mark as Answer" for any post which has helped you. This will give recognition to those helping others as well as earn you a point. It also helps people know which posts still need work.
"tempid159" <>
NewsGroup User
Re: App_Code not working properly?7/19/2007 3:58:55 PM

0

"Yes, all my classes in the app_code folder are public by default. "

I mean, when I created those classes, I made all of them public.

and sorry for the double post..

"tempid159" <>
NewsGroup User
Re: App_Code not working properly?7/19/2007 4:11:12 PM

0

Brendan,

Your quick responses are very much appreciated. Thanks.

I gave my aspx.cs a namespace and tried accessing this class from app_code but it doesn't show up.. and the files in app_code show up only the namespaces of app_code. I want to merge all of them.

Thanks for your time.

 

"tempid159" <>
NewsGroup User
Re: App_Code not working properly?7/20/2007 3:02:25 PM

0

I got it work.. The issue is with the Resharper addon I installed. It's blocking access to the class for some reason.

I told this problem to a friend and he took a look at it and said it was working fine on his machine as expected and he doesn't have resharper installed.

I uninstalled resharper on my machine and it worked perfectly.

Just an FYI for anybody out there who are facing this issue.

Thanks. Happy coding.

10 Items, 1 Pages 1 |< << Go >> >|




   
  Privacy | Contact Us
All Times Are GMT