如何在运行时设置母版页上另一个页面上的按钮的属性? [英] how can I set the properties of button which is on master page from another page at run time?

查看:48
本文介绍了如何在运行时设置母版页上另一个页面上的按钮的属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在该aspx页面的Go按钮的单击事件上,从另一个aspx页面设置母版页面中按钮的可见属性.
有人可以帮我吗?
在此先感谢
---- Rohit

I want to set the visible property of the button which is in master page from the another aspx page on click event of Go button of that aspx page.
Can anybody help me?
Thanks in advance
---- Rohit

推荐答案

好吧,您如何看待呢?您是否对编程一无所知,或者只是在设计器中拖了几步?您认为您需要做什么?

您的页面具有Master属性,该属性的类型为MasterPage或其他类型.它实际上是您的母版页的一个实例.那么,程序员在这种情况下会做什么?初学者可以使用该Master属性,对其进行转换,然后从那里访问master实例中的内容.真正的程序员会为其页面创建一个基类,该基类的属性是所使用母版页的强类型实例,因此易于访问.
well, how do you think you might do it ? Do you know anything about programming, or have you just been dragging stuff about in the designer ? What do you think you need to do ?

Your page has a Master property, which is of type MasterPage, or something. It''s actually an instance of YOUR master page. So, what would a programmer do in this instance ? A beginner would take that Master property, upcast it, and then access stuff inside the master instance from there. A real programmer would create a base class for his pages that has a property that is a strongly typed instance of the master page being used, so that it''s easy to access.


非常感谢基督徒.其实我知道Master属性,但是我也想知道是否可能.
Well Thank you very much Christian. Actually I know the Master property but then also I wanted to know is it possible or not.


这篇关于如何在运行时设置母版页上另一个页面上的按钮的属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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