A page(a.aspx) load a userWebControl(b.ascx) userWebControl(b.ascx) create a new TextBox txtB and set txtb.ID="BBB",what is the name of txtB in webpage(a.aspx).I view a.aspx source code in IE only ID="BBB" no Name=something. so I CAN NOT locate the txtB control by using FindControl("BBB").a.aspx
TextBox b = FindControl("BBB");
//b=null
p.s. I can not input chinese, sorry about that.
TextBox b = FindControl("BBB");
//b=null
p.s. I can not input chinese, sorry about that.
解决方案 »
- 在研究这个网站。是啥技术做得?求教一下!!
- 高手请进,jquery.load方法在IE6下系统错误:1072896748
- 页面跳转问题
- web asp C#语言 开发 关于图片上传到文件夹后删除问题~
- 在DataList里怎么才能实现双向排序?急啊。。。
- JavaScript怎样取得DataList里面CheckBox的值
- tabContainer刷新后tabIndex恢复为0的问题,怎么解决
- 谁会控件开发开发啊教教我啊??
- jmail发附件的问题!!!
- 要命vs 2003 做第一个项目(不可恢复的生成错误) 重建N个工程试了都没有用.(救命啦,明天要出小样了)
- 歌词同步的代码谁帮忙改改
- c#如何用md5加密方式?
userWebControl usrC = findcontrol("userWebControl1")
next
textbox b = usrC.findControl("BBB");
try it
ScheduleItemFields schItem = (ScheduleItemFields)LoadControl("ScheduleItemFields.ascx");
schItem.ID = "AAA";
m_panScheduleItem.Controls.Add(schItem); //m_panScheduleItem is a Panel
... this.FindControl("AAA") //return null
this.FindControl("m_panScheduleItem").FindControl("AAA") //return null//this.FindControl("m_panScheduleItem") dosen't return null but this.FindControl("m_panScheduleItem").FindControl("AAA") DOES
然后 在界面上拖放了一个panel,后台代码如下 ProductGroupDropDown pgd = (ProductGroupDropDown)LoadControl("~/Control/ProductGroupDropDown.ascx");
pgd.ID = "aaa";
Panel1.Controls.Add(pgd);
Panel p1 = (Panel)Master.FindControl("ContentPlaceHolder1").FindControl("Panel1");
if (p1 == null)
{
}
else
{
ProductGroupDropDown pd1 = (ProductGroupDropDown)p1.FindControl("aaa");
DropDownList dr = (DropDownList)p1.FindControl("DropDownList1");
}
我测试 是可以的,你看看
,然后 通过Panel 找用户控件,并且可以找到 用户控件的 dropdownlist
thank you.