NeonRant
8/13/2019 - 4:21 AM

Showing and hiding markup with placeholders

To show and hide blocks of markup, you can use asp: Placeholders, so in the code behind, you would show it or hide it like so: if (chkApprentice.Checked) { plcTrainee.Visible = false; plcApprentice.Visible = true; }

<asp:PlaceHolder ID="plcApprentice" runat="server">
  <div class="row">
    <div class="col-12">
      <div class="form-group">
        <asp:Label ID="lblApprenticeProbation" runat="server" CssClass="label" AssociatedControlID="txtApprenticeProbationPeriod" EnableViewState="false">Probation Period in Months <em>*</em></asp:Label>
        <asp:TextBox ID="txtApprenticeProbationPeriod" runat="server" CssClass="form-control" placeholder="e.g. 6"></asp:TextBox>
      </div>
    </div>
  </div>
</asp:PlaceHolder>