|
It is not possible to initialize the user control now. My intention is to talk about my environment: My productadd.aspx page has an add.ascx user control user control to add products, but now the user requires that multiple products can be added at one time, so I want to use the dynamic loading of this add.ascx to add multiple products. I used your code above: When adding add.ascx, when executing the if(!ispostback) in the load in add.ascx, although add.ascx is It was loaded for the first time but productadd.aspx was not loaded for the first time, so the code inside would not be executed and the content in my add.ascx could not be initialized as the following code ascx: <asp:TextBox id="TextBox1" runat="server"></ asp:TextBox> <asp:Button id="Button1" runat="server" Text="Button"></asp:Button> ascx.cs: load() {if(!IsPostBack) {TextBox1.Text="dd "; //dd is the database read}} btn_click() {update to the database} Thank you |
|