如何从内容页面调用嵌套在RadDockableObject内部的usercontrol内部的方法? [英] How to call method inside of usercontrol which is nested inside of RadDockableObject from content page?

查看:85
本文介绍了如何从内容页面调用嵌套在RadDockableObject内部的usercontrol内部的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码.我可以找到Asp.net UserControl并使用属性,但是我需要在其中调用特定的方法.谁能告诉我该怎么做?

Here is my code. I'm able to find Asp.net UserControl and play with attributes but I need to call specific method inside of it. Can anyone tell me how to do it?

var usercontrol = (UserControl)RadDockableObject1.FindControl("ControlName");
usercontrol.Visible = true;
usercontrol.MethodName();

推荐答案

您需要将其强制转换为适当的类型.现在,您将其投射到UserControl.这将使您可以访问一组属性和方法,但不是全部.将其强制转换为特定类型,您将可以访问所有内容.一切非私有的都是...

You need to cast it to the appropriate type. Right now you are casting it to UserControl. That will give you access to a set of properties and methods, but not all. Cast it to the particular type and you will have access to everything. Everything that is not-private that is...

这篇关于如何从内容页面调用嵌套在RadDockableObject内部的usercontrol内部的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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