简体   繁体   中英

How to make .ascx properties settable in .aspx files

I have a user control that has a public property defined in the code-behind (.ascx.cs). Is there a way for this property to be set directly inside the tag of the .aspx file that the control is being used? I can already access the property in the code-behind of the .aspx file.

除非我缺少明显的东西,否则很容易...

<uc1:MyCtrl runat="server" MyVal="this value" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM