如何从Web用户控件中获取价值 [英] How to get value from Web User Control

查看:121
本文介绍了如何从Web用户控件中获取价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经使用文本框,图像按钮和日历控件创建了Web用户控件,以获取选定的日期.我想显示从TextBox到Web窗体上的Lable的选定值.

Hi,

I have created web user control using Text box, Image Button and calendar control to get selected Date. I want to show the selected value from TextBox to Lable, which is on Web Form.
How to access User Control TextBox value?

推荐答案

^ ]


TextBox txt =(TextBox)onlyNumber3.FindControl("txtText1");
字符串s = txt.Text;

这里的OnlyNumber3 id Web用户控件id
textText1是网络用户控件的文本框ID
TextBox txt = (TextBox)onlyNumber3.FindControl("txtText1");
string s = txt.Text;

Here OnlyNumber3 id web user control id
textText1 is web user control textbox id


这篇关于如何从Web用户控件中获取价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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