Gridview的非公共成员 [英] Non-Public member of Gridview

查看:61
本文介绍了Gridview的非公共成员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在asp.net中访问Gridview的非公共成员?

请帮助

How to access Non-Public member of Gridview in asp.net?
Please Help

推荐答案

您可以访问任何成员,公众和非公众使用反思。如果您需要,请阅读反思。这很简单。请从这里开始:

http://msdn.microsoft.com/ en-us / library / system.reflection.aspx [ ^ ]。



然而,有些东西告诉我你并不真的需要它。如果你需要反射,你不会问你提到的具体的 GridView 类型。你只是无法达到一些功能,并意味着滥用课程。访问说明符是故意编写的。找到使用库组件的合法方法,学习它们。



太糟糕了,你没有解释你想要的访问目的。如果你这样做了,你会得到一些更有用的建议。但在那个时候,你当然需要改善你的想法。这个论坛上一个典型的荒谬问题类型是:编译器(例外)告诉我:'你不能做X'。我的问题是:如何做X? :-)。



-SA
You can access any members, public and non-public using reflection. If you need it, read on reflection. This is easy. Please start here:
http://msdn.microsoft.com/en-us/library/system.reflection.aspx[^].

However, something tells me that you don't really need it. If you needed reflection, you would not ask about a concrete GridView type you mentioned. You just cannot reach some feature and mean to abuse the class. Access specifiers are written on purpose. Find the legitimate ways of using library components, learn them.

Too bad you did not explain the purpose of the access you wanted. If you did, you would get some more useful advice. But at that time, you certainly need to improve your thinking. One of the typical ridiculous question types on this forum is: "Compiler (exception) tells me: 'you cannot do X'. My question is: how to do X?" :-).

—SA


这篇关于Gridview的非公共成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆