更新时间:2023-10-11 12:00:46
您可以通过以下方式访问您的用户控件隐藏的文件值var hdn = YourUserControl.FindControl( yourhiddencontrolid);
或者你也可以在你的用户控件中创建一个属性,它会返回你隐藏的文件值......public string HiddenFiledValue {
get {
return myHiddenFiled.Value;
}
set {
myHiddenFiled.Value = value ;
}
}
并在您的父页面中使用该属性,如下所示......
yourusercontrol.HiddenFiledValue块引用>
你有没有试过这样的,
什么HiddenField Info = this.Page.FindControl(MyHiddenField);
-KR
Hi,
I have a hidden control in a aspx page . I want to get its value in the user control page that binds the aspx page...Please helpyour can access your user control hidden filed value by following waysvar hdn = YourUserControl.FindControl("yourhiddencontrolid");
Or you can also create a properties in your user control which is returning your hidden filed value like this...public string HiddenFiledValue { get{ return myHiddenFiled.Value; } set{ myHiddenFiled.Value = value; } }
and use that property in your parent page like this...yourusercontrol.HiddenFiledValue
Have you not tried anything like this,HiddenField Info = this.Page.FindControl("MyHiddenField");
-KR