In general, we will focus on implementing functions in the ascx file so that the functions can be used for multiple times. However, in some cases, we may use operations on the page container where the user control is located.
In fact, if you think about it, the principle is also very simple. If ascx is used, it will appear in the page container, you can call the findcontrol method to operate the corresponding control through the page attribute of the class of the ascx.
There is another problem. We often encounter that when we click a button on the page, we find that the corresponding event is not executed, usually because the page initialization engine initializecomponent (); no event is registered.
In another case, there are two forms in An ASPX page, one of which does not have runat = server, and the corresponding button after it appears does not have a response. I am not quite familiar with the specific reasons. But at least the result is that the subsequent events are not sent back to the server.