0

I have a a class called CUser. I'm tyring to call a function in this class in another aspx page I have. This is how Im calling it:

CUser Logic = new CUser();
DataList1.DataSource = Logic.GetAllDate();
DataList1.DataBind();

Im getting the following error The type or name space name 'CUser' couldnt be found. My CUser class is in appcode in a folder named BLL. Am i missing something?

Thanks,

3
  • 2
    Have you included the assembly as a reference? Commented Jun 20, 2011 at 14:53
  • No shouldnt it recongize the class as it is in the app_code folder? Commented Jun 20, 2011 at 14:54
  • If you have no namespace around your CUser class, it should be visible immediately to your ASPX page. Otherwise use the using directive. Commented Jun 20, 2011 at 14:59

2 Answers 2

2

If your class is in a folder it is likely that it is in another Namespace. You have to include it into your file where your are using your CUser class.

As an example: using MyApp.BLL;

Using Namespaces

Sign up to request clarification or add additional context in comments.

Comments

1

Does it have the NameSpace?

If it has the namespace, you have to type like:

YourNameSpace.CUser Logic = new YourNameSpace.CUser();

Or, put using statement at the top like:

using YourNameSpace;

And, have you built your website? Sometimes, you need to recompile/build the website to reflect the latest changes.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.