WebUserControl [英] WebUserControl

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

问题描述

我如何从webusercontrol访问页面控件
并且此页面包含母版页

how can i access to page control from webusercontrol
and this page contains a master page

推荐答案

this.Page,并用于访问母版页
this.Master
this.Page and for accessing master page
this.Master


好,谢谢大家

我现在拥有Good Now,因为我做了以下事情:

ContentPlaceHolder CPH =(ContentPlaceHolder)Page.Master.FindControl("ContentPlaceHolder1");

标签控件示例

标签lbl = CPH.FindControl("Label1")作为标签;
Ok, Thanks For All

I have Good Now because i did the following:

ContentPlaceHolder CPH=(ContentPlaceHolder) Page.Master.FindControl("ContentPlaceHolder1");

example on label control

Label lbl=CPH.FindControl("Label1") as Label;


您是否尝试过Page属性:rolleyes:
Have you tried the Page property :rolleyes:


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

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