protected void ddlSearchCategory_SelectedIndexChanged(object sender, EventArgs e) { if (ddlSearchCategory.SelectedItem.Text != "Select") { // To bind first ddl value list.. DataSet ds = new DataSet(); LPDetailsBAL lp = new LPDetailsBAL(); ds = lp.FetchLP(); ddlSearchCategory1.DataSource = ds.Tables[2]; ddlSearchCategory1.DataTextField = "Lpcategoryname"; ddlSearchCategory1.DataValueField = "Lpcategoryid"; ddlSearchCategory1.DataBind(); ddlSearchCategory1.Items.Insert(0, "Select"); } else { ddlSearchCategory1.Items.Clear(); ddlSearchCategory1.Items.Add("Select"); // fetch value of the grid details.... DataSet ds1 = new DataSet(); LPDetailsBAL lp1 = new LPDetailsBAL(); ds1 = lp1.FetchLP(); grdLP.DataSource = ds1.Tables[0]; grdLP.DataBind(); } }
protected void btnLPSave_Click(object sender, EventArgs e) { int active = 0; if (chkActive.Checked == true) { active = 1; } if (string.IsNullOrEmpty(lblLPEdit.Text)) { int a = 0; LPDetailsBAL lp = new LPDetailsBAL(); a = lp.SaveLP(txtLPName.Text, ddlLPCategory.SelectedItem.Text, txtDescription.Text, ddlReligion.SelectedItem.Text, ddlDynasty.SelectedItem.Text, active); if (a != 0) { Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('LP Details Added.');location='AddLPDetails.aspx';", true); } Clear(); FetchDetails(); } else { int a = 0; LPDetailsBAL lp = new LPDetailsBAL(); a = lp.UpdateLP(lblLPEdit.Text, txtLPName.Text, ddlLPCategory.SelectedItem.Text, txtDescription.Text, ddlReligion.SelectedItem.Text, ddlDynasty.SelectedItem.Text, active); if (a != 0) { Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('LP Details updated.');location='AddLPDetails.aspx';", true); } Clear(); FetchDetails(); } }
protected void btnLPSave_Click(object sender, EventArgs e) { int active = 0; if (chkActive.Checked == true) active = 1; if (string.IsNullOrEmpty(lblLPEdit.Text)) { int a = 0; LPDetailsBAL lp = new LPDetailsBAL(); a = lp.SaveLP(txtLPName.Text, ddlLPCategory.SelectedItem.Text, txtDescription.Text, ddlReligion.SelectedItem.Text, ddlDynasty.SelectedItem.Text, active); if (a != 0) Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('LP Details Added.');location='AddLPDetails.aspx';", true); Clear(); FetchDetails(); } else { int a = 0; LPDetailsBAL lp = new LPDetailsBAL(); a = lp.UpdateLP(lblLPEdit.Text, txtLPName.Text, ddlLPCategory.SelectedItem.Text, txtDescription.Text, ddlReligion.SelectedItem.Text, ddlDynasty.SelectedItem.Text, active); if (a != 0) Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('LP Details updated.');location='AddLPDetails.aspx';", true); Clear(); FetchDetails(); } }
protected void Gridview_OnRowCommand(object sender, GridViewCommandEventArgs e) { string _commandName; if (e.CommandArgument.ToString() == "Next" || e.CommandArgument.ToString() == "Last" || e.CommandArgument.ToString() == "First" || e.CommandArgument.ToString() == "Prev") { gridviewLP.Enabled = true; } else { // Get the selected index and the command name int _selectedIndex = int.Parse(e.CommandArgument.ToString()); _commandName = e.CommandName; if (_commandName == "Lpedit") { Label lpid = (Label)gridviewLP.Rows[_selectedIndex].Cells[0].FindControl("lblGridLpId"); DataTable editdetails = new DataTable(); LPDetailsBAL lp = new LPDetailsBAL(); editdetails = lp.FetchLPDetails(lpid.Text); lblLPEdit.Text = editdetails.Rows[0][0].ToString(); txtLPName.Text = editdetails.Rows[0][1].ToString(); txtDescription.Text = editdetails.Rows[0][3].ToString(); ddlLPCategory.ClearSelection(); ddlLPCategory.Items.FindByText(editdetails.Rows[0][2].ToString()).Selected = true; ddlReligion.ClearSelection(); ddlReligion.Items.FindByText(editdetails.Rows[0][4].ToString()).Selected = true; ddlDynasty.ClearSelection(); ddlDynasty.Items.FindByText(editdetails.Rows[0][5].ToString()).Selected = true; if (editdetails.Rows[0][2].ToString().ToLower() == "king") { ddlReligion.Enabled = false; ddlDynasty.Enabled = true; } else if (editdetails.Rows[0][2].ToString().ToLower() == "saint") { ddlReligion.Enabled = true; ddlDynasty.Enabled = false; } else { ddlReligion.Enabled = false; ddlDynasty.Enabled = false; } if (Convert.ToInt32(editdetails.Rows[0][6].ToString()) == 1) { chkActive.Checked = true; } else { chkActive.Checked = false; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region Fetch Grid Page Size Details... DataTable pg = new DataTable(); GeneralBAL pz = new GeneralBAL(); pg = pz.FetchGridPageSize(); if (pg.Rows.Count != 0 && pg.Rows[0][0].ToString() != string.Empty) { grdLP.PageSize = Convert.ToInt32(pg.Rows[0][0].ToString()); } #endregion // Bind the banner of the image. DataSet ds = new DataSet(); GeneralDAL lp = new GeneralDAL(); ds = lp.FetchBanner(); if (ds.Tables[2].Rows.Count != 0) { imgBanner.ImageUrl = ds.Tables[2].Rows[0][1].ToString(); } //End Bind the banner of the image. // fetch value of the grid details.... DataSet ds1 = new DataSet(); LPDetailsBAL lp1 = new LPDetailsBAL(); ds1 = lp1.FetchLP(); grdLP.DataSource = ds1.Tables[0]; grdLP.DataBind(); if (Request.QueryString["LPId"] != null) { int rowno = 0; for (int i = 0; ds1.Tables[0].Rows.Count > i; i++) { if (ds1.Tables[0].Rows[i]["LPId"].ToString() == Request.QueryString["LPId"].ToString()) { rowno = i; } } FetchGridDetails(Request.QueryString["LPId"].ToString()); grdLP.PageIndex = rowno / grdLP.PageSize; int SelectedRowIndex = rowno - (grdLP.PageSize * grdLP.PageIndex); grdLP.DataBind(); grdLP.Rows[SelectedRowIndex].BackColor = System.Drawing.Color.LightGray; }//other load festival here..... else { if (ds1.Tables[0].Rows.Count != 0) { FetchGridDetails(ds1.Tables[0].Rows[0][0].ToString()); grdLP.Rows[0].BackColor = System.Drawing.Color.LightGray; } //End fetch value of the grid details.... } } }
private void FetchDetails() { LPDetailsBAL lp = new LPDetailsBAL(); ds = lp.FetchLP(); gridviewLP.DataSource = ds.Tables[0]; gridviewLP.DataBind(); }
protected void gridPageChanging(object sender, GridViewPageEventArgs e) { LPDetailsBAL lp = new LPDetailsBAL(); ds = lp.FetchLP1(); gridviewLP.DataSource = ds.Tables[0]; gridviewLP.PageIndex = e.NewPageIndex; gridviewLP.DataBind(); }
protected void btnLPDelete_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(lblLPEdit.Text)) { int a = 0; LPDetailsBAL lp = new LPDetailsBAL(); a = lp.DeleteLP(lblLPEdit.Text); if (a != 0) Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('LP Details Deleted.');location='AddLPDetails.aspx';", true); Clear(); FetchDetails(); } else Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('Select LP Details to Delete.');location='AddLPDetails.aspx';", true); }
protected void Page_Load(object sender, EventArgs e) { Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1)); Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetNoStore(); if (!IsPostBack) { ddlReligion.Enabled = false; ddlDynasty.Enabled = false; #region Fetch Grid Page Size Details... DataTable pg = new DataTable(); GeneralBAL pz = new GeneralBAL(); pg = pz.FetchGridPageSize(); if (pg.Rows.Count != 0 && pg.Rows[0][1].ToString() != string.Empty) { gridviewLP.PageSize = Convert.ToInt32(pg.Rows[0][1].ToString()); } #endregion LPDetailsBAL lp = new LPDetailsBAL(); ds = lp.FetchLP1(); ddlReligion.DataSource = ds.Tables[1]; ddlReligion.DataTextField = "ReligionName"; ddlReligion.DataValueField = "ReligionID"; ddlReligion.DataBind(); ddlReligion.Items.Insert(0, "==Select=="); ddlLPCategory.DataSource = ds.Tables[2]; ddlLPCategory.DataTextField = "Lpcategoryname"; ddlLPCategory.DataValueField = "Lpcategoryid"; ddlLPCategory.DataBind(); ddlLPCategory.Items.Insert(0, "==Select=="); ddlDynasty.DataSource = ds.Tables[3]; ddlDynasty.DataTextField = "DynastyName"; ddlDynasty.DataValueField = "DynastyID"; ddlDynasty.DataBind(); ddlDynasty.Items.Insert(0, "==Select=="); gridviewLP.DataSource = ds.Tables[0]; gridviewLP.DataBind(); } }
protected void btnLPDelete_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(lblLPEdit.Text)) { int a = 0; LPDetailsBAL lp = new LPDetailsBAL(); a = lp.DeleteLP(lblLPEdit.Text); if (a != 0) { Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('LP Details Deleted.');location='AddLPDetails.aspx';", true); } Clear(); FetchDetails(); } else { Page.ClientScript.RegisterStartupScript(typeof(Page), "key", "alert('Select LP Details to Delete.');location='AddLPDetails.aspx';", true); } }
protected void gridPageChanging(object sender, GridViewPageEventArgs e) { if (ddlSearchCategory.SelectedItem.Text == "Select" & ddlSearchCategory1.SelectedItem.Text == "Select") { DataSet ds1 = new DataSet(); LPDetailsBAL lp1 = new LPDetailsBAL(); ds1 = lp1.FetchLP(); grdLP.DataSource = ds1.Tables[0]; grdLP.PageIndex = e.NewPageIndex; grdLP.DataBind(); } else { DataTable ds = new DataTable(); GeneralBAL lp = new GeneralBAL(); ds = lp.FetchLPGridDetails(ddlSearchCategory1.SelectedItem.Text); grdLP.DataSource = ds; grdLP.PageIndex = e.NewPageIndex; grdLP.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1)); Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetNoStore(); if (!IsPostBack) { ddlReligion.Enabled = false; ddlDynasty.Enabled = false; #region Fetch Grid Page Size Details... DataTable pg = new DataTable(); GeneralBAL pz = new GeneralBAL(); pg = pz.FetchGridPageSize(); if (pg.Rows.Count != 0 && pg.Rows[0][1].ToString() != string.Empty) gridviewLP.PageSize = Convert.ToInt32(pg.Rows[0][1].ToString()); #endregion LPDetailsBAL lp = new LPDetailsBAL(); ds = lp.FetchLP1(); ddlReligion.DataSource = ds.Tables[1]; ddlReligion.DataTextField = "ReligionName"; ddlReligion.DataValueField = "ReligionID"; ddlReligion.DataBind(); ddlReligion.Items.Insert(0, "==Select=="); ddlLPCategory.DataSource = ds.Tables[2]; ddlLPCategory.DataTextField = "Lpcategoryname"; ddlLPCategory.DataValueField = "Lpcategoryid"; ddlLPCategory.DataBind(); ddlLPCategory.Items.Insert(0, "==Select=="); ddlDynasty.DataSource = ds.Tables[3]; ddlDynasty.DataTextField = "DynastyName"; ddlDynasty.DataValueField = "DynastyID"; ddlDynasty.DataBind(); ddlDynasty.Items.Insert(0, "==Select=="); gridviewLP.DataSource = ds.Tables[0]; gridviewLP.DataBind(); } }
protected void Gridview_OnRowCommand(object sender, GridViewCommandEventArgs e) { string _commandName; if (e.CommandArgument.ToString() == "Next" || e.CommandArgument.ToString() == "Last" || e.CommandArgument.ToString() == "First" || e.CommandArgument.ToString() == "Prev") { gridviewLP.Enabled = true; } else { // Get the selected index and the command name int _selectedIndex = int.Parse(e.CommandArgument.ToString()); _commandName = e.CommandName; if (_commandName == "Lpedit") { Label lpid = (Label)gridviewLP.Rows[_selectedIndex].Cells[0].FindControl("lblGridLpId"); DataTable editdetails = new DataTable(); LPDetailsBAL lp = new LPDetailsBAL(); editdetails = lp.FetchLPDetails(lpid.Text); lblLPEdit.Text = editdetails.Rows[0][0].ToString(); txtLPName.Text = editdetails.Rows[0][1].ToString(); txtDescription.Text = editdetails.Rows[0][3].ToString(); ddlLPCategory.ClearSelection(); ddlLPCategory.Items.FindByText(editdetails.Rows[0][2].ToString()).Selected = true; ddlReligion.ClearSelection(); ddlReligion.Items.FindByText(editdetails.Rows[0][4].ToString()).Selected = true; ddlDynasty.ClearSelection(); ddlDynasty.Items.FindByText(editdetails.Rows[0][5].ToString()).Selected = true; if (editdetails.Rows[0][2].ToString().ToLower() == "king") { ddlReligion.Enabled = false; ddlDynasty.Enabled = true; } else if (editdetails.Rows[0][2].ToString().ToLower() == "saint") { ddlReligion.Enabled = true; ddlDynasty.Enabled = false; } else { ddlReligion.Enabled = false; ddlDynasty.Enabled = false; } if (Convert.ToInt32(editdetails.Rows[0][6].ToString()) == 1) chkActive.Checked = true; else chkActive.Checked = false; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region Fetch Grid Page Size Details... DataTable pg = new DataTable(); GeneralBAL pz = new GeneralBAL(); pg = pz.FetchGridPageSize(); if (pg.Rows.Count != 0 && pg.Rows[0][0].ToString() != string.Empty) grdLP.PageSize = Convert.ToInt32(pg.Rows[0][0].ToString()); #endregion // Bind the banner of the image. DataSet ds = new DataSet(); GeneralDAL lp = new GeneralDAL(); ds = lp.FetchBanner(); if (ds.Tables[2].Rows.Count != 0) imgBanner.ImageUrl = ds.Tables[2].Rows[0][1].ToString(); //End Bind the banner of the image. // fetch value of the grid details.... DataSet ds1 = new DataSet(); LPDetailsBAL lp1 = new LPDetailsBAL(); ds1 = lp1.FetchLP(); grdLP.DataSource = ds1.Tables[0]; grdLP.DataBind(); if (Request.QueryString["LPId"] != null) { int rowno = 0; for (int i = 0; ds1.Tables[0].Rows.Count > i; i++) { if (ds1.Tables[0].Rows[i]["LPId"].ToString() == Request.QueryString["LPId"].ToString()) rowno = i; } FetchGridDetails(Request.QueryString["LPId"].ToString()); grdLP.PageIndex = rowno / grdLP.PageSize; int SelectedRowIndex = rowno - (grdLP.PageSize * grdLP.PageIndex); grdLP.DataBind(); grdLP.Rows[SelectedRowIndex].BackColor = System.Drawing.Color.LightGray; }//other load festival here..... else { if (ds1.Tables[0].Rows.Count != 0) { FetchGridDetails(ds1.Tables[0].Rows[0][0].ToString()); grdLP.Rows[0].BackColor = System.Drawing.Color.LightGray; } //End fetch value of the grid details.... } } }
protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) { if (DropDownList2.SelectedItem.Text == "Banner") { trBanner.Visible = true; trGallery.Visible = false; trGrid.Visible = false; tr2.Visible = false; trgrid4.Visible = false; DataSet ds1 = new DataSet(); GeneralDAL lp = new GeneralDAL(); ds1 = lp.FetchBanner(); if (DropDownList1.SelectedItem.Text == "Historical Spots") GridView2.DataSource = ds1.Tables[1]; else if (DropDownList1.SelectedItem.Text == "LP") GridView2.DataSource = ds1.Tables[2]; else if (DropDownList1.SelectedItem.Text == "Festivals") GridView2.DataSource = ds1.Tables[3]; else if (DropDownList1.SelectedItem.Text == "Home") GridView2.DataSource = ds1.Tables[0]; GridView2.DataBind(); } else if (DropDownList2.SelectedItem.Text == "Gallery") { tr2.Visible = false; trgrid4.Visible = false; trBanner.Visible = false; trGallery.Visible = true; trGrid.Visible = true; tr1.Visible = false; GridView1.DataSource = null; GridView1.DataBind(); if (DropDownList1.SelectedItem.Text == "Historical Spots") { lblColumn.Text = "Spot Name"; DataSet ds = new DataSet(); SpotDetailsBAL sp = new SpotDetailsBAL(); ds = sp.FetchSpotDetails1(); ddlColumn.DataSource = ds.Tables[4]; ddlColumn.DataTextField = "spotname"; ddlColumn.DataValueField = "spotid"; ddlColumn.DataBind(); ddlColumn.Items.Insert(0, "Select"); RequiredFieldValidator1.ErrorMessage = "Choose Spot Name"; } else if (DropDownList1.SelectedItem.Text == "LP") { lblColumn.Text = "LP Category Name"; DataSet ds = new DataSet(); LPDetailsBAL lp = new LPDetailsBAL(); ds = lp.FetchLP1(); ddlColumn.DataSource = ds.Tables[2]; ddlColumn.DataTextField = "lpcategoryname"; ddlColumn.DataValueField = "lpcategoryid"; ddlColumn.DataBind(); ddlColumn.Items.Insert(0, "Select"); RequiredFieldValidator1.ErrorMessage = "Choose LP Category Name"; } else if (DropDownList1.SelectedItem.Text == "Festivals") { lblColumn.Text = "Festival Name"; DataSet ds = new DataSet(); FestivalBAL fs = new FestivalBAL(); ds = fs.FetchFestival1(); ddlColumn.DataSource = ds.Tables[0]; ddlColumn.DataTextField = "Name"; ddlColumn.DataValueField = "FestivalID"; ddlColumn.DataBind(); ddlColumn.Items.Insert(0, "Select"); RequiredFieldValidator1.ErrorMessage = "Choose Festival Name"; } else { lblColumn.Text = string.Empty; ddlColumn.Items.Clear(); ddlColumn.Items.Add("Select"); } } else if (DropDownList2.SelectedItem.Text == "Map") { tr2.Visible = true; trgrid4.Visible = true; trBanner.Visible = false; trGallery.Visible = false ; trGrid.Visible = false; tr1.Visible = false; // GridView3.DataSource = null; GridView3.DataBind(); if (DropDownList1.SelectedItem.Text == "Historical Spots") { Label8.Text = "Spot Name"; DataSet ds = new DataSet(); SpotDetailsBAL sp = new SpotDetailsBAL(); ds = sp.FetchSpotDetails1(); DropDownList3.DataSource = ds.Tables[4]; DropDownList3.DataTextField = "spotname"; DropDownList3.DataValueField = "spotid"; DropDownList3.DataBind(); DropDownList3.Items.Insert(0, "Select"); RequiredFieldValidator1.ErrorMessage = "Choose Spot Name"; } else if (DropDownList1.SelectedItem.Text == "LP") { lblColumn.Text = "LP Category Name"; DataSet ds = new DataSet(); LPDetailsBAL lp = new LPDetailsBAL(); ds = lp.FetchLP1(); ddlColumn.DataSource = ds.Tables[2]; ddlColumn.DataTextField = "lpcategoryname"; ddlColumn.DataValueField = "lpcategoryid"; ddlColumn.DataBind(); ddlColumn.Items.Insert(0, "Select"); RequiredFieldValidator1.ErrorMessage = "Choose LP Category Name"; } else if (DropDownList1.SelectedItem.Text == "Festivals") { lblColumn.Text = "Festival Name"; DataSet ds = new DataSet(); FestivalBAL fs = new FestivalBAL(); ds = fs.FetchFestival1(); ddlColumn.DataSource = ds.Tables[0]; ddlColumn.DataTextField = "Name"; ddlColumn.DataValueField = "FestivalID"; ddlColumn.DataBind(); ddlColumn.Items.Insert(0, "Select"); RequiredFieldValidator1.ErrorMessage = "Choose Festival Name"; } else { lblColumn.Text = string.Empty; ddlColumn.Items.Clear(); ddlColumn.Items.Add("Select"); } } else { trBanner.Visible = false; trGallery.Visible = false; trGrid.Visible = false; tr2.Visible = false; trgrid4.Visible = false; } }
protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) { if (DropDownList2.SelectedItem.Text == "Banner") { trBanner.Visible = true; trGallery.Visible = false; trGrid.Visible = false; tr2.Visible = false; trgrid4.Visible = false; DataSet ds1 = new DataSet(); GeneralDAL lp = new GeneralDAL(); ds1 = lp.FetchBanner(); if (DropDownList1.SelectedItem.Text == "Historical Spots") { GridView2.DataSource = ds1.Tables[1]; } else if (DropDownList1.SelectedItem.Text == "LP") { GridView2.DataSource = ds1.Tables[2]; } else if (DropDownList1.SelectedItem.Text == "Festivals") { GridView2.DataSource = ds1.Tables[3]; } else if (DropDownList1.SelectedItem.Text == "Home") { GridView2.DataSource = ds1.Tables[0]; } GridView2.DataBind(); } else if (DropDownList2.SelectedItem.Text == "Gallery") { tr2.Visible = false; trgrid4.Visible = false; trBanner.Visible = false; trGallery.Visible = true; trGrid.Visible = true; tr1.Visible = false; GridView1.DataSource = null; GridView1.DataBind(); if (DropDownList1.SelectedItem.Text == "Historical Spots") { lblColumn.Text = "Spot Name"; DataSet ds = new DataSet(); SpotDetailsBAL sp = new SpotDetailsBAL(); ds = sp.FetchSpotDetails1(); ddlColumn.DataSource = ds.Tables[4]; ddlColumn.DataTextField = "spotname"; ddlColumn.DataValueField = "spotid"; ddlColumn.DataBind(); ddlColumn.Items.Insert(0, "Select"); RequiredFieldValidator1.ErrorMessage = "Choose Spot Name"; } else if (DropDownList1.SelectedItem.Text == "LP") { lblColumn.Text = "LP Category Name"; DataSet ds = new DataSet(); LPDetailsBAL lp = new LPDetailsBAL(); ds = lp.FetchLP1(); ddlColumn.DataSource = ds.Tables[2]; ddlColumn.DataTextField = "lpcategoryname"; ddlColumn.DataValueField = "lpcategoryid"; ddlColumn.DataBind(); ddlColumn.Items.Insert(0, "Select"); RequiredFieldValidator1.ErrorMessage = "Choose LP Category Name"; } else if (DropDownList1.SelectedItem.Text == "Festivals") { lblColumn.Text = "Festival Name"; DataSet ds = new DataSet(); FestivalBAL fs = new FestivalBAL(); ds = fs.FetchFestival1(); ddlColumn.DataSource = ds.Tables[0]; ddlColumn.DataTextField = "Name"; ddlColumn.DataValueField = "FestivalID"; ddlColumn.DataBind(); ddlColumn.Items.Insert(0, "Select"); RequiredFieldValidator1.ErrorMessage = "Choose Festival Name"; } else { lblColumn.Text = string.Empty; ddlColumn.Items.Clear(); ddlColumn.Items.Add("Select"); } } else if (DropDownList2.SelectedItem.Text == "Map") { tr2.Visible = true; trgrid4.Visible = true; trBanner.Visible = false; trGallery.Visible = false; trGrid.Visible = false; tr1.Visible = false; // GridView3.DataSource = null; GridView3.DataBind(); if (DropDownList1.SelectedItem.Text == "Historical Spots") { Label8.Text = "Spot Name"; DataSet ds = new DataSet(); SpotDetailsBAL sp = new SpotDetailsBAL(); ds = sp.FetchSpotDetails1(); DropDownList3.DataSource = ds.Tables[4]; DropDownList3.DataTextField = "spotname"; DropDownList3.DataValueField = "spotid"; DropDownList3.DataBind(); DropDownList3.Items.Insert(0, "Select"); RequiredFieldValidator1.ErrorMessage = "Choose Spot Name"; } else if (DropDownList1.SelectedItem.Text == "LP") { lblColumn.Text = "LP Category Name"; DataSet ds = new DataSet(); LPDetailsBAL lp = new LPDetailsBAL(); ds = lp.FetchLP1(); ddlColumn.DataSource = ds.Tables[2]; ddlColumn.DataTextField = "lpcategoryname"; ddlColumn.DataValueField = "lpcategoryid"; ddlColumn.DataBind(); ddlColumn.Items.Insert(0, "Select"); RequiredFieldValidator1.ErrorMessage = "Choose LP Category Name"; } else if (DropDownList1.SelectedItem.Text == "Festivals") { lblColumn.Text = "Festival Name"; DataSet ds = new DataSet(); FestivalBAL fs = new FestivalBAL(); ds = fs.FetchFestival1(); ddlColumn.DataSource = ds.Tables[0]; ddlColumn.DataTextField = "Name"; ddlColumn.DataValueField = "FestivalID"; ddlColumn.DataBind(); ddlColumn.Items.Insert(0, "Select"); RequiredFieldValidator1.ErrorMessage = "Choose Festival Name"; } else { lblColumn.Text = string.Empty; ddlColumn.Items.Clear(); ddlColumn.Items.Add("Select"); } } else { trBanner.Visible = false; trGallery.Visible = false; trGrid.Visible = false; tr2.Visible = false; trgrid4.Visible = false; } }