Search code examples
jqueryvb.netvisual-studio-2017controlsascx

How to order controls from a pre-determined order


I have registered some controls on a page and set their public properties server side no problem so they display as intended. Now there is a requirement to set the order of the controls on page load dynamically from ordering values saved in a database table. As per the code shown on the ascx page the ordering is currently static and sequential. Is there a way to set the order based on the database ordering values either from the server or using jQuery etc?

<tbody>
  <tr>
    <td>
      <controls:PrintMDTHeader ID="PrintMDTHeader1" runat="server" />
      <controls:PrintMDTStaging ID="PrintMDTStaging1" runat="server" />
      <controls:PrintMDTPresentation ID="PrintMDTPresentation1" runat="server" />
      <controls:PrintMDTInvestigation ID="PrintMDTInvestigation1" runat="server" />
      <controls:PrintMDTDiagnosis ID="PrintMDTDiagnosis1" runat="server" />
      <controls:PrintMDTNonPrimary ID="PrintMDTNonPrimary1" runat="server" />
    </td>
  </tr>
</tbody>

Solution

  • Didn't think of this but

    <asp:PlaceHolder />
    

    fits the bill nicely