Introduction to ASP. NET User Controls

Source: Internet
Author: User

Access the data in the user control on the page:

Method 1:
Use the FindControl method of the user control to find the control in the user control and obtain its data (you do not need to process it in the control, but you need to know the ID of the control to be used in the user control)
Method 2:

Add a property (method) for the control and use this property to access data in the user control (it is easy to use in the target page, but not flexible enough)

Access the control in the page control in the user control:

Method 1:
Use the Parent property in the user control to find the page, and then use the FindControl method to find the control to access

Method 2:
Add events to the user control, process events on the page, and access the control on the page.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.