Access child user control's property in parent user control

后端 未结 4 1083
悲&欢浪女
悲&欢浪女 2021-01-15 01:44

I have included a user control in another statically following code :


place the folowing directive in the asp code of the parent page or usercontrol:

<

4条回答
  •  攒了一身酷
    2021-01-15 02:20

    It's funny but whenever you add a property to a user control.

    You need to register it again in the parent. So in your case,

    Add a space at the end of this line and remove it again: $<% Register src="~/MyControl.ascx" tagname="MyControl" tagprefix="uc1" %>

    This will re - register the user control and you will be able to access new properties.

提交回复
热议问题