如何使用对象获取类的方法? [英] How to get a method of a class using object?
本文介绍了如何使用对象获取类的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在通过n层架构进行asp.net项目.但是,当我使用一个包时,假设在UI层中使用业务逻辑层包并创建该包的类的实例,然后尝试使用该对象调用方法,而我找不到该类的任何方法.我举一个例子-
I''m doing a asp.net project by n-tier architecture. But when i use a packare suppose Business Logic layer package in UI layer and create a instance of a class of that packege and than try to call a method using that object than i coouldn''t find any method of that class. I''m giving a example-
using ENSII.BAL;
protected void ButtonAddCat_Click(object sender, EventArgs e)
{
string category = TextBoxCat.Text;
CatagoryHierarchy cat = new CatagoryHierarchy();
cat.{can't get required method of BAL.CatagoryHierarchy to use}
}
推荐答案
您可以尝试将您的类保留在APP_CODE文件夹中.
它可以解决您的问题.您将可以访问所有方法.
欢呼声:-O
U can try keeping your class in APP_CODE Folder.
It can solve your problem.And u will be able to access the methods and all.
Cheers :-O
这篇关于如何使用对象获取类的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文