View Code for Web/WebControls/EditCourse.ascx

Source code for the file Web/WebControls/EditCourse.ascx is shown below.

<%@ Control CodeBehind="EditCourse.ascx.cs" Inherits="QuantumConcepts.CodeGenerator.Sample.Web.WebControls.EditCourse" Language="C#" %>
<%@ Register TagPrefix="Common" TagName="TabularPanel" Src="~/WebControls/TabularPanel.ascx" %>
<%@ Register TagPrefix="Common" TagName="TabularPanelRow" Src="~/WebControls/TabularPanelRow.ascx" %>
<%@ Register TagPrefix="Common" TagName="TabularPanelField" Src="~/WebControls/TabularPanelField.ascx" %>

<Common:TabularPanel runat="server">
  <Rows>
    <Common:TabularPanelRow>
      <Fields>
        <Common:TabularPanelField>
          <Label>Semester:</Label>
          <Value>
            <asp:DropDownList ID="SemesterField" runat="server" AppendDataBoundItems="true" DataValueField="ID" DataTextField="Name">
              <asp:ListItem Text="Select..." />
            </asp:DropDownList>
            <Common:FieldValidator ID="SemesterIDValidator" runat="server" TargetControlID="SemesterField" FieldName="Semester" Required="true" />
          </Value>
        </Common:TabularPanelField>
      </Fields>
    </Common:TabularPanelRow>
    <Common:TabularPanelRow>
      <Fields>
        <Common:TabularPanelField>
          <Label>Teacher:</Label>
          <Value>
            <asp:DropDownList ID="TeacherField" runat="server" AppendDataBoundItems="true" DataValueField="ID" DataTextField="FullName">
              <asp:ListItem Text="Select..." />
            </asp:DropDownList>
            <Common:FieldValidator ID="TeacherIDValidator" runat="server" TargetControlID="TeacherField" FieldName="Teacher" Required="true" />
          </Value>
        </Common:TabularPanelField>
      </Fields>
    </Common:TabularPanelRow>
    <Common:TabularPanelRow>
      <Fields>
        <Common:TabularPanelField>
          <Label>Number:</Label>
          <Value>
            <asp:TextBox ID="NumberField" runat="server" />
            <Common:FieldValidator ID="NumberValidator" runat="server" TargetControlID="NumberField" FieldName="Number" Required="true" />
          </Value>
        </Common:TabularPanelField>
      </Fields>
    </Common:TabularPanelRow>
    <Common:TabularPanelRow>
      <Fields>
        <Common:TabularPanelField>
          <Label>Name:</Label>
          <Value>
            <asp:TextBox ID="NameField" runat="server" />
            <Common:FieldValidator ID="NameValidator" runat="server" TargetControlID="NameField" FieldName="Name" Required="true" />
          </Value>
        </Common:TabularPanelField>
      </Fields>
    </Common:TabularPanelRow>
    <Common:TabularPanelRow>
      <Fields>
        <Common:TabularPanelField>
          <Label>Status:</Label>
          <Value>
            <asp:DropDownList ID="CourseStatusField" runat="server" AppendDataBoundItems="true" DataValueField="Value" DataTextField="Description">
              <asp:ListItem Text="Select..." />
            </asp:DropDownList>
            <Common:FieldValidator ID="StatusValidator" runat="server" TargetControlID="CourseStatusField" FieldName="Status" Required="true" />
          </Value>
        </Common:TabularPanelField>
      </Fields>
    </Common:TabularPanelRow>
  </Rows>
  <Actions>
    <asp:LinkButton ID="SaveButton" runat="server" Text="Save" CssClass="Action Accept" OnClick="SaveButton_Click" />
    <asp:LinkButton ID="CancelButton" runat="server" Text="Cancel" CssClass="Action Cancel" OnClick="CancelButton_Click" />
  </Actions>
</Common:TabularPanel>