访问webuser控件中的控件以按下按钮单击的代码 [英] Access a control in a webuser control to codebehind of button click

查看:61
本文介绍了访问webuser控件中的控件以按下按钮单击的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我

我有一个.aspx页面包含



1.一个webusercontrol(登录),其中包含一个linklabel( lblstart)

2.A asp按钮btnstart

现在我的问题是我想点击btnstart

解决方案时访问linklabel

什么是linklabel?



假设webusercontrol的id是LoginControl并且它有一个id为lblLogin的标签。要从后面的代码访问标签lblLogin,请尝试以下内容:



标签lbl =  new  Label(); 
lbl =(Label)LoginControl.FindControl( lblLogin);


please help me
I have an .aspx page Which contains

1.A webusercontrol(login) which contains a linklabel(lblstart)
2.A asp button btnstart
now my problem is that i want to access the linklabel while we click the btnstart

解决方案

What is a linklabel?

Suppose the webusercontrol's id is "LoginControl" and it has a label with id "lblLogin". To access label "lblLogin" from code behind try following:

Label lbl = new Label();
lbl = (Label)LoginControl.FindControl("lblLogin");


这篇关于访问webuser控件中的控件以按下按钮单击的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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