简体   繁体   中英

how to use functionality from existing aspx page in usercontrol?

I am trying to use existing functionality which is embedded in a asp.net aspx page. So I have controls on this page and code behind for it. What is the best way to reuse this functionality in a new ascx control? Or do I just have to copy everyting into the control?

Can you not just take the controls you want to use from the aspx page and turn those into a control? Then you can use that control wherever you like.

To access the page parent just written this.Page in your control. But for access to these methods, you must apply an interface to the aspx page.

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