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