protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            int    farmId            = 0;
            int    plotId            = 0;
            string contactIdsFromGET = "";

            if ((Request.QueryString["farmId"] != "") && (Request.QueryString["farmId"] != null))
            {
                int.TryParse(Request.QueryString["farmId"], out farmId);
            }

            if ((Request.QueryString["plotId"] != "") && (Request.QueryString["plotId"] != null))
            {
                int.TryParse(Request.QueryString["plotId"], out plotId);
            }

            contactIdsFromGET = Request.QueryString["contactIds"];

            FarmIdHiddenField.Value     = farmId.ToString();
            PlotIdHiddenField.Value     = plotId.ToString();
            ContactIdsHiddenField.Value = contactIdsFromGET;

            try
            {
                // Get the common web service instance.
                ServiceAccess           serviceLoader = ServiceAccess.GetInstance();
                FarmService.FarmService farmService   = serviceLoader.GetFarm();

                //Getting Farm Name
                FarmService.FarmInfo farm = farmService.GetFarmDetail(farmId);
                FarmNameLabel.Text = farm.FarmName;

                //Getting From Plot Name
                FarmService.PlotInfo plot = farmService.GetPlotDetail(plotId);
                PlotNameLabel.Text = plot.PlotName;

                //Get Plot List for the Farm
                IList <FarmService.PlotInfo> plots = farmService.GetPlotListSummaryForFarm(farmId);
                PlotListDropDownList.DataSource     = plots;
                PlotListDropDownList.DataValueField = "PlotId";
                PlotListDropDownList.DataTextField  = "PlotName";
                PlotListDropDownList.DataBind();
                PlotListDropDownList.Items.Insert(0, new ListItem("<Select a Plot>", "-1"));
                PlotListDropDownList.Items.Remove(PlotListDropDownList.Items.FindByValue(plotId.ToString()));
                PlotListDropDownList.Items.Add(new ListItem("New Plot ...", "-2"));
                PlotListDropDownList.Attributes.Add("onChange", "javascript: newPlot(this);");
                NewPlotHiddenField.Value = "";
            }
            catch (Exception exception)
            {
                log.Error("UNKNOWN ERROR WHILE LOADING MOVECONTACT:", exception);
                ErrorLiteral.Text  = "Unable to Load the Farm";
                SaveButton.Visible = false;
            }
        }
        else
        {
            if ((NewPlotHiddenField.Value.ToString() != "") && (PlotListDropDownList.SelectedValue.ToString() == "-2"))
            {
                PlotListDropDownList.Items.FindByValue("-2").Text = NewPlotHiddenField.Value.ToString();
            }
            else
            {
                PlotListDropDownList.Items.FindByValue("-2").Text = "New Plot ...";
                NewPlotHiddenField.Value = "";
            }
        }
    }