Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 20, 2013 07:48 PM by TheLDSEcMAn
Jan 20, 2012 04:07 AM|LINK
I've written a .cs class inside the App_Code folder in an ASP.NET project. It compiles fine. However, when I try to inherit from it from a .aspx.cs file, which is located inside the project but outside of any folder, I get a compile error: "The type or namespace
name '...' could not be found (are you missing a user directive or an assembly reference?)". How can I solve it?
I'm using ASP.NET 4 and Visual Studio
Jan 20, 2012 04:10 AM|LINK
Make sure you app_code class is public.
Jan 20, 2012 04:18 AM|LINK
Plz make your class as Public Class......
Jan 20, 2012 04:20 AM|LINK
Is you appcode class public?
Jan 20, 2012 04:21 AM|LINK
As stated above, make sure the app class is public... also make sure you add a reference to the class.
Jan 20, 2012 04:26 AM|LINK
Your class file are any folder of APP_Code
if yes then please use namespace in your .cs code
like if your class file is in folder DAL then
using DAL ;
and be sure that there the class file are public .
if this will help you marka as answer
Jan 20, 2012 04:42 AM|LINK
My class is public, but I don't know how to add to the references.
Jan 20, 2012 04:45 AM|LINK
The class is directly inside App_Code. It is public. When I write using App_Code, I get compile error. Sorry, don't know what you mean.
Jan 20, 2012 04:49 AM|LINK
Is there some connection to the Inherit property at the .aspx markup file? It's the last property of the first line. But I tried to change it and it doesnt seem to help.
Jan 20, 2012 04:51 AM|LINK
Can you pls share your code, both class file and .aspx code ??