The user control that dynamically transmits values. The object reference is not set to the instance of the object.

Source: Internet
Author: User

      A user control is added to the page. The user control needs to be dynamically passed to the user control based on the user's selection, and the user control must be clear.

   A variable that is passed through the get and set methods.

 

      I thought this was the case. What is depressing is that the first loading is correct. After the selection is changed (that is, the value to be transferred has changed

   ), The page reports"",I did not find the cause after searching for half a day. debugging found that users on the page

   The control object is null. After searching for the Internet for half a day, I finally learned why. If you want to set the user control value, you cannot cache the user control.

 

       That is to say, the user control cannot be added. <% @ Outputcache duration = "1000" varybyparam = "*" %>

   After the control is cached, The mycontrol object will not be available on the page. The object is always null.

 

       Everything is clear !!!

Recorded here

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.