I have a panel that I'm trying to add a user control to from the code behind. The issue is the loaded control does not appear in the panel once the code runs. Am I missing something?
<div id="ShippingDetails" runat="server" visible="true">
<asp:Panel ID="Panel1" runat="server"></asp:Panel>
</div>
</form>
</asp:Content>
Code behind:
protected void Page_PreRender(object sender, EventArgs e)
{
if (OrderSearch1.SelectedValues != null)
{
InitializeShippingDetailControls();
}
}
public void InitializeShippingDetailControls()
{
admin_InputControl control = new admin_InputControl();
control.InitializeInputControl(ShippingDetailInputControls, new DataModels.EDIOrderShipmentInfo(), 1, "Shipment Details");
Panel1.Controls.Add(control);
}