Thursday, November 17, 2022

Master page with two content Place Holder ASP.NET C#

Master page


 <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="cms.Master.cs" Inherits="cadre_mgmt_system.Site1" %>

<%@ Register Src="~/usercontrol/footer.ascx" TagPrefix="uc1" TagName="footer" %>

<%@ Register Src="~/usercontrol/header.ascx" TagPrefix="uc1" TagName="header" %>

<!DOCTYPE html>


<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title>ICAR Cadre Management System</title>

    <style>

        body {

            margin: 0px !important;

            padding: 0px !important;

        }


        .header {

            height: 80px;

            line-height: 80px !important;

        }


        .height {

            height: 80px;

        }


        .w3-lobster {

            font-family: "Lobster", serif !important;

        }


        .letter-spacing {

            letter-spacing: 2px;

        }


        .grad1 {

            background: #f29e62; /* For browsers that do not support gradients */

            background: -webkit-linear-gradient(#f29e62,#ffd800); /* For Safari 5.1 to 6.0 */

            background: -o-linear-gradient(#f29e62,#ffd800); /* For Opera 11.1 to 12.0 */

            background: -moz-linear-gradient(#f29e62,#ffd800); /* For Firefox 3.6 to 15 */

            background: linear-gradient(#f29e62,#ffd800); /* Standard syntax (must be last) */

        }


        .small {

            font-size: 12px;

        }


        .clear {

            clear: both;

        }


        .col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12, .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {

            position: initial !important;

        }


        .radiobtn input {

            margin-right: 10px;

            height: 20px;

        }


        .radiobtn label {

            margin-right: 20px;

        }

        .label{

            font-size:100% !important;

        }

    </style>

    <link rel="stylesheet" href="Content/bootstrap.min.css" />

    <link rel="stylesheet" href="Content/css/bootstrap-theme.min.css" />

    

    <script src="https://code.jquery.com/jquery-1.12.4.js"></script>

    <link rel="stylesheet" href="Content/css/jquery-ui.css" />

    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lobster">

    

    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

    <script src="Content/js/bootstrap.min.js"></script>

    <asp:ContentPlaceHolder ID="head" runat="server">

    </asp:ContentPlaceHolder>

</head>

<body>

    <form id="form1" runat="server">

        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

        <uc1:header runat="server" id="header" />

        <div class="pull-right hidden-print" style="clear: both">

            <asp:Label runat="server" ID="lblUsername"></asp:Label>

            <asp:LinkButton runat="server" ID="logout" OnClick="logout_Click" CssClass="btn btn-danger btn-xs">Logout</asp:LinkButton>

            <asp:LinkButton runat="server" ID="changePassword" PostBackUrl="~/changepassword.aspx" CssClass="btn btn-default btn-xs">Change Password</asp:LinkButton>

        </div>

        <div class="clear">

            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

            </asp:ContentPlaceHolder>

        </div>

        <uc1:footer runat="server" id="footer" />

        

    </form>

</body>

</html>



------------------

Aspx page


<%@ Page Title="" Language="C#" MasterPageFile="~/cms.Master" AutoEventWireup="true" CodeBehind="newEmployee.aspx.cs" Inherits="cadre_mgmt_system.WebForm4" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script>
        $(function () {
            var $gv = $("table[id$=grdViewEmpList]");
            var $rows = $("> tbody > tr:not(:has(th, table))", $gv);
            var $inputs = $(".Datepicker", $rows);
            $inputs.datepicker();
        });
        $(function () {
            $("#txtDob").datepicker({
                changeMonth: true,
                changeYear: true
            });
        });
        $(function () {
            $("#txtApointmentDate").datepicker({
                changeMonth: true,
                changeYear: true
            });
        });
        $(function () {
            $("#txtApointmentDateSS").datepicker({
                changeMonth: true,
                changeYear: true
            });
        });
        $(function () {
            $("#txtPIPD").datepicker({
                changeMonth: true,
                changeYear: true
            });
        });
        $(function () {
            $("#txtDOR").datepicker({
                changeMonth: true,
                changeYear: true
            });
        });
        $(function () {
            $("#txtADP").datepicker({
                changeMonth: true,
                changeYear: true
            });
        });
        $(function () {
            $("#txtDeputationFrom").datepicker({
                changeMonth: true,
                changeYear: true
            });
        });
        $(function () {
            $("#txtDeputationTo").datepicker({
                changeMonth: true,
                changeYear: true
            });
        });
        $(function () {
            $("#txtStudyLeaveFrom").datepicker({
                changeMonth: true,
                changeYear: true
            });
        });
        $(function () {
            $("#txtStudyLeaveTo").datepicker({
                changeMonth: true,
                changeYear: true
            });
        });
    </script>
    <style>
        .row {
            clear: both;
            margin: 0px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <a href="employee.aspx" class="btn btn-warning btn-sm">Back</a>
    <h3 class="">Add New Employee</h3>
    <div class="text-center h3">
        <asp:Label runat="server" ID="ltrStatus" CssClass="text-danger"></asp:Label>
    </div>
    <div class="text-center h4">Select Cadre Type</div>
    <div class="col-md-12">
        <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" ErrorMessage="Required" InitialValue="Select" ControlToValidate="ddlPositions" CssClass="text-danger" Display="Dynamic" SetFocusOnError="True" ValidationGroup="add"></asp:RequiredFieldValidator>
        <asp:DropDownList runat="server" ID="ddlPositions" CssClass="form-control"></asp:DropDownList>
    </div>
    <div class="col-md-12">
        Previous Organization
        <asp:RequiredFieldValidator runat="server" ID="requiredPreviousOrganization" CssClass="text-danger" Display="Dynamic" ControlToValidate="ddlPreviousOrganization" InitialValue="Select" ErrorMessage="Required" SetFocusOnError="True" ValidationGroup="add"></asp:RequiredFieldValidator>
        <asp:DropDownList runat="server" ID="ddlPreviousOrganization" CssClass="form-control">
            <asp:ListItem Value="Select">Select</asp:ListItem>
            <asp:ListItem Value="ICAR">ICAR</asp:ListItem>
            <asp:ListItem Value="NICAR">Non-ICAR</asp:ListItem>
        </asp:DropDownList>
        
    </div>
    <br />
    <div class="row">
        <div class="col-md-1">Discipline</div>
        <div class="col-md-3">
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Required" ControlToValidate="ddlDiscipline" CssClass="text-danger" Display="Dynamic" SetFocusOnError="True" ValidationGroup="add"></asp:RequiredFieldValidator>
            <asp:DropDownList ID="ddlDiscipline" runat="server" CssClass="form-control"></asp:DropDownList>
        </div>
    </div>
    <br />
    <div class="row">
        <div class="col-md-1">Title</div>
        <div class="col-md-2">
            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="Required" ControlToValidate="ddlTitle" CssClass="text-danger" InitialValue=" " SetFocusOnError="True" Display="Dynamic" ValidationGroup="add"></asp:RequiredFieldValidator>
            <asp:DropDownList ID="ddlTitle" runat="server" CssClass="form-control">
                <asp:ListItem></asp:ListItem>
                <asp:ListItem>Dr.</asp:ListItem>
                <asp:ListItem>Mr.</asp:ListItem>
                <asp:ListItem>Ms.</asp:ListItem>
            </asp:DropDownList>
        </div>
        <div class="col-md-1">Name &nbsp;</div>
        <div class="col-md-4">
            <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="Required" ControlToValidate="txtName" CssClass="text-danger" InitialValue=" " SetFocusOnError="True" Display="Dynamic" ValidationGroup="add"></asp:RequiredFieldValidator>
            <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("Name") %>' CssClass="form-control" placeholder="Enter Name"></asp:TextBox>

        </div>
        <div class="col-md-2">ERP ID  &nbsp;</div>
        <div class="col-md-2">
            <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ErrorMessage="Required" ControlToValidate="txtFMSID" CssClass="text-danger" InitialValue=" " SetFocusOnError="True" Display="Dynamic" ValidationGroup="add"></asp:RequiredFieldValidator>
            <asp:TextBox ID="txtFMSID" runat="server" MaxLength="6" Text='<%# Bind("FMSID") %>' placeholder="Enter 6 digit FMSID" CssClass="form-control"></asp:TextBox>
            <asp:RegularExpressionValidator runat="server" ID="validFMSID" ControlToValidate="txtFMSID" SetFocusOnError="true" ValidationExpression="^[0-9]*$" EnableClientScript="true" ErrorMessage="Invalid FMS ID" CssClass="text-danger" Display="Dynamic" ValidationGroup="add"></asp:RegularExpressionValidator>
        </div>
    </div>
    <br />
    <div class="row">
        <div class="col-md-1">Gender</div>
        <div class="col-md-3">
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Required" ControlToValidate="ddlGender" CssClass="text-danger" InitialValue=" " SetFocusOnError="True" Display="Dynamic" ValidationGroup="add"></asp:RequiredFieldValidator>
            <asp:DropDownList CssClass="form-control" ID="ddlGender" runat="server">
                <asp:ListItem></asp:ListItem>
                <asp:ListItem>Female</asp:ListItem>
                <asp:ListItem>Male</asp:ListItem>
                <asp:ListItem>Transgender</asp:ListItem>
            </asp:DropDownList>
        </div>
        <div class="col-md-1">Reservation Category</div>
        <div class="col-md-3">
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Required" ControlToValidate="ddlCategory" CssClass="text-danger" InitialValue=" " SetFocusOnError="True" Display="Dynamic" ValidationGroup="add"></asp:RequiredFieldValidator>
            <asp:DropDownList ID="ddlCategory" runat="server" CssClass="form-control">
                <asp:ListItem></asp:ListItem>
                <asp:ListItem>UR</asp:ListItem>
                <asp:ListItem>SC</asp:ListItem>
                <asp:ListItem>ST</asp:ListItem>
                <asp:ListItem>OBC</asp:ListItem>
                <asp:ListItem>Minority</asp:ListItem>
                <asp:ListItem>PC</asp:ListItem>
            </asp:DropDownList>
        </div>
        <div class="col-md-1">Roster Category</div>
        <div class="col-md-3">
            <asp:DropDownList ID="ddlRosterCategory" runat="server" CssClass="form-control">
                <asp:ListItem></asp:ListItem>
                <asp:ListItem>UR</asp:ListItem>
                <asp:ListItem>SC</asp:ListItem>
                <asp:ListItem>ST</asp:ListItem>
                <asp:ListItem>OBC</asp:ListItem>
                <asp:ListItem>PC</asp:ListItem>
            </asp:DropDownList>
        </div>

    </div>
    <br />
    <div class="row">
        <div class="col-md-1">DOB</div>
        <div class="col-md-3">
            <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ErrorMessage="Required" ControlToValidate="txtDob" CssClass="text-danger" InitialValue=" " SetFocusOnError="True" Display="Dynamic" ValidationGroup="add"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="regcheckdate" runat="server" ControlToValidate="txtDob"
                Display="Dynamic" ErrorMessage="Invalid Date Format" SetFocusOnError="True"
                CssClass="text-danger" ValidationExpression="^(0[1-9]|1[0-2])\/(0[1-9]|1\d|2\d|3[01])\/(19|20)\d{2}$"></asp:RegularExpressionValidator>
            <asp:TextBox ID="txtDob" ClientIDMode="Static" CssClass="form-control" runat="server" Text='<%# Bind("DOB") %>'></asp:TextBox>
        </div>
        <div class="col-md-2">Appointment Date (MM/DD/YYYY)</div>
        <div class="col-md-2">
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtApointmentDate"
                Display="Dynamic" ErrorMessage="Invalid Date Format" SetFocusOnError="True"
                CssClass="text-danger" ValidationExpression="^(0[1-9]|1[0-2])\/(0[1-9]|1\d|2\d|3[01])\/(19|20)\d{2}$"></asp:RegularExpressionValidator>
            <asp:TextBox ID="txtApointmentDate" ClientIDMode="Static" runat="server" CssClass="form-control" Text='<%# Bind("AppointmentDate") %>'></asp:TextBox>
        </div>
        <div class="col-md-1">Present Designation</div>
        <div class="col-md-2">
            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Required" ControlToValidate="ddlDesignation" CssClass="text-danger" InitialValue=" " SetFocusOnError="True" Display="Dynamic" ValidationGroup="add"></asp:RequiredFieldValidator>
            <asp:DropDownList ID="ddlDesignation" CssClass="form-control" runat="server"></asp:DropDownList>
        </div>
    </div>
    <br />
    <div class="row">
        <div class="col-md-2">Appointment Date of Present Designation (MM/DD/YYYY)</div>
        <div class="col-md-4">
            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtADP"
                Display="Dynamic" ErrorMessage="Invalid Date Format" SetFocusOnError="True"
                CssClass="text-danger" ValidationExpression="^(0[1-9]|1[0-2])\/(0[1-9]|1\d|2\d|3[01])\/(19|20)\d{2}$"></asp:RegularExpressionValidator>
            <asp:TextBox ID="txtADP" runat="server" ClientIDMode="Static" CssClass="form-control" Text='<%# Bind("AppointmentDatePresent") %>'></asp:TextBox>
        </div>
        <div class="col-md-2">Present Institute Posting Date (MM/DD/YYYY)</div>
        <div class="col-md-4">
            <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="txtPIPD"
                Display="Dynamic" ErrorMessage="Invalid Date Format" SetFocusOnError="True"
                CssClass="text-danger" ValidationExpression="^(0[1-9]|1[0-2])\/(0[1-9]|1\d|2\d|3[01])\/(19|20)\d{2}$"></asp:RegularExpressionValidator>
            <asp:TextBox ID="txtPIPD" runat="server" ClientIDMode="Static" CssClass="form-control" Text='<%# Bind("PresentInstitutePostingDate") %>'></asp:TextBox>
        </div>
    </div>
    <div>
        <div class="col-md-4">Appointment Date in DR-SS/DR-PS Cadre (as the case may be) (MM/DD/YYYY) (use inbuilt Calender only)</div>
        <div class="col-md-8">
            <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ControlToValidate="txtApointmentDateSS"
                Display="Dynamic" ErrorMessage="Invalid Date Format" SetFocusOnError="True"
                CssClass="text-danger" ValidationExpression="^(0[1-9]|1[0-2])\/(0[1-9]|1\d|2\d|3[01])\/(19|20)\d{2}$"></asp:RegularExpressionValidator>
            <asp:TextBox ID="txtApointmentDateSS" runat="server" ClientIDMode="Static" CssClass="form-control" Text='<%# Bind("AppointmentDateSS") %>'></asp:TextBox>
        </div>
    </div>
    <br />
    <div class="row form-group">
        <div class="col-md-2">Institute</div>
        <div class="col-md-4">
            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="Required" ControlToValidate="ddlInstitute" CssClass="text-danger" InitialValue=" " SetFocusOnError="True" Display="Dynamic" ValidationGroup="add"></asp:RequiredFieldValidator>
            <asp:DropDownList ID="ddlInstitute" runat="server" CssClass="form-control" OnSelectedIndexChanged="ddlInstitute_SelectedIndexChanged" AutoPostBack="True"></asp:DropDownList>
        </div>
        <div class="col-md-2">Regional Station in which posted (city Name)</div>
        <div class="col-md-4">
            <asp:DropDownList ID="ddlRegionalStation" runat="server" CssClass="form-control" DataTextField="RSName" DataValueField="I_Code"></asp:DropDownList>
        </div>
    </div>
    <br />
    <div class="row form-group">
        <div class="col-md-2">Mobile (don't prefix 0)</div>
        <div class="col-md-4">
            <asp:RegularExpressionValidator runat="server" ID="validMobile" ControlToValidate="txtMobile" SetFocusOnError="true" ValidationExpression="^[789]\d{9}$" EnableClientScript="true" Display="Dynamic" ErrorMessage="Invalid Mobile Number" CssClass="text-danger" ValidationGroup="add"></asp:RegularExpressionValidator>
            <asp:TextBox ID="txtMobile" runat="server" MaxLength="10" placeholder="Enter 10 digit Number" CssClass="form-control"></asp:TextBox>
        </div>
        <div class="col-md-2">Email</div>
        <div class="col-md-4">
            <asp:RegularExpressionValidator runat="server" ID="validEmail" Display="Dynamic" ControlToValidate="txtEmail" SetFocusOnError="true" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" EnableClientScript="true" ErrorMessage="Invalid Email" CssClass="text-danger" ValidationGroup="add"></asp:RegularExpressionValidator>
            <asp:TextBox ID="txtEmail" runat="server" CssClass="form-control" placeholder="eg. user@example.com"></asp:TextBox>
        </div>
    </div>
    <br />
    <div class="row form-group">
        <div class="col-md-2">On Deputation</div>
        <div class="col-md-5">
            <asp:RegularExpressionValidator ID="RegularExpressionValidator8" runat="server" ControlToValidate="txtDeputationFrom"
                Display="Dynamic" ErrorMessage="Invalid Date Format" SetFocusOnError="True"
                CssClass="text-danger" ValidationExpression="^(0[1-9]|1[0-2])\/(0[1-9]|1\d|2\d|3[01])\/(19|20)\d{2}$"></asp:RegularExpressionValidator>
            From :<asp:TextBox ID="txtDeputationFrom" ClientIDMode="Static" CssClass="form-control" runat="server" Text='<%# Bind("DeputationFrom") %>'></asp:TextBox>
        </div>
        <div class="col-md-5">
            <asp:RegularExpressionValidator ID="RegularExpressionValidator7" runat="server" ControlToValidate="txtDeputationTo"
                Display="Dynamic" ErrorMessage="Invalid Date Format" SetFocusOnError="True"
                CssClass="text-danger" ValidationExpression="^(0[1-9]|1[0-2])\/(0[1-9]|1\d|2\d|3[01])\/(19|20)\d{2}$"></asp:RegularExpressionValidator>
            To :<asp:TextBox ID="txtDeputationTo" runat="server" ClientIDMode="Static" CssClass="form-control" Text='<%# Bind("DeputationTo") %>'></asp:TextBox>
            <asp:CompareValidator ID="CompareValidatorDeputation" ControlToValidate="txtDeputationTo" ControlToCompare="txtDeputationFrom" CssClass="text-danger" EnableClientScript="true" SetFocusOnError="true" Type="Date" Operator="GreaterThan" runat="server" ErrorMessage="Must be greater than above." Display="Dynamic" ValidationGroup="add"></asp:CompareValidator>
        </div>
    </div>
    <br />
    <div class="row form-group">
        <div class="col-md-2">Study Leave (Period)</div>
        <div class="col-md-5">
            <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" ControlToValidate="txtStudyLeaveFrom"
                Display="Dynamic" ErrorMessage="Invalid Date Format" SetFocusOnError="True"
                CssClass="text-danger" ValidationExpression="^(0[1-9]|1[0-2])\/(0[1-9]|1\d|2\d|3[01])\/(19|20)\d{2}$"></asp:RegularExpressionValidator>
            From:<asp:TextBox ID="txtStudyLeaveFrom" ClientIDMode="Static" runat="server" CssClass="form-control" Text='<%# Bind("StudyLeaveFrom") %>'></asp:TextBox>
        </div>
        <div class="col-md-5">
            <asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" ControlToValidate="txtStudyLeaveTo"
                Display="Dynamic" ErrorMessage="Invalid Date Format" SetFocusOnError="True"
                CssClass="text-danger" ValidationExpression="^(0[1-9]|1[0-2])\/(0[1-9]|1\d|2\d|3[01])\/(19|20)\d{2}$"></asp:RegularExpressionValidator>
            To :<asp:TextBox ID="txtStudyLeaveTo" runat="server" ClientIDMode="Static" CssClass="form-control" Text='<%# Bind("StudyLeaveTo") %>'></asp:TextBox>
            <asp:CompareValidator ID="CompareValidatorStudyLeave" ControlToValidate="txtStudyLeaveTo" ControlToCompare="txtStudyLeaveFrom" CssClass="text-danger" EnableClientScript="true" SetFocusOnError="true" Type="Date" Operator="GreaterThan" runat="server" ErrorMessage="Must be greater than above." Display="Dynamic" ValidationGroup="add"></asp:CompareValidator>
        </div>
    </div>
    <br />
    <div class="row">
        <div class="col-md-2">Remarks</div>
        <div class="col-md-10">
            <asp:TextBox ID="txtRemarks" TextMode="MultiLine" Rows="3" runat="server" Text='<%# Bind("Remarks") %>' CssClass="form-control"></asp:TextBox>
        </div>
    </div>
    <div class="col-md-12 text-center">
        <br />
        <asp:Button runat="server" ID="btnAdd" Text="Please verify accuracy of Entered data and Submit" CssClass="btn btn-success" OnClick="btnAdd_Click" ValidationGroup="add" />
        <asp:Button runat="server" ID="btnReset" Text="Reset" CssClass="btn btn-danger" OnClick="btnReset_Click" ValidationGroup="reset" />

    </div>
    <div class="text-center">
        <asp:Button ID="btnSubmit" runat="server" Text="Submit" CssClass="btn btn-success" OnClick="btnSubmit_Click" />
    </div>
</asp:Content>

No comments:

Post a Comment