protected void dlstState_ItemCommand(object source, DataListCommandEventArgs e) { LinkButton lbtnState = (LinkButton)e.Item.FindControl("lbtnState"); lbtnState1.Text = lbtnState.Text; mvMain.SetActiveView(viewTours); WebDataAccess webDataAccess = new WebDataAccess(); DataTable dt = webDataAccess.GetTourByState("D", tourSubType, Convert.ToInt32(lbtnState.CommandArgument)); dlstTour.DataSource = dt; dlstTour.DataBind(); int tourId = 0; foreach (DataListItem item in dlstTour.Items) { DataRow row = dt.Rows[item.ItemIndex]; if (!string.IsNullOrEmpty(Convert.ToString(row["WEB_PHOTO_CONTENT"]))) { ImageButton imgPhoto = (ImageButton)item.FindControl("imgPhoto"); if (imgPhoto != null) { Int32.TryParse(imgPhoto.CommandArgument, out tourId); //HttpContext.Current.Session["DataRow"] = row; imgPhoto.ImageUrl = "~/Shared/ImageHandler.ashx?id=" + tourId + "&phototype=tour"; } } if (!string.IsNullOrEmpty(Convert.ToString(row["NO_OF_NIGHTS"])) && !string.IsNullOrEmpty(Convert.ToString(row["NO_OF_DAYS"]))) { Label lblDayss = (Label)item.FindControl("lblDayss"); if (lblDayss != null) { lblDayss.Text = row["NO_OF_NIGHTS"].ToString() + " Nights/" + row["NO_OF_DAYS"].ToString() + " Days"; } } } }