protected void pointList_ItemDataBound(object sender, DataListItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { Control control = e.Item.Controls[0]; Label label = (Label) control.FindControl("lblPointType"); if (label != null) { if (label.Text == "0") { label.Text = "兑换优惠券"; } else if (label.Text == "1") { label.Text = "兑换礼品"; } else if (label.Text == "2") { label.Text = "购物奖励"; } else if (label.Text == "3") { label.Text = "退款扣积分"; } } } }
protected void ImagesList_ItemDataBound(object sender, DataListItemEventArgs e) { Panel ImagePanel = (Panel)e.Item.FindControl("ImagePanel"); Label FileNameLabel = (Label)ImagePanel.FindControl("FileNameLabel"); Image ShowImage = (Image)ImagePanel.FindControl("ShowImage"); Label UploaderLabel = (Label)ImagePanel.FindControl("UploaderLabel"); Label SubmissionDate = (Label)ImagePanel.FindControl("SubmissionDateLabel"); Models.Images img = (Models.Images)e.Item.DataItem; if (img.FileName.Length >= 13) { string shortFileName = img.FileName.Substring(0, 13); FileNameLabel.Text = shortFileName + "..."; } else { FileNameLabel.Text = img.FileName; } FileNameLabel.ToolTip = img.FileName; ShowImage.ImageUrl = string.Format("~/Files/{0}/Images/{1}", img.Uploader, img.FileName); ShowImage.Width = 100; ShowImage.Height = 100; ShowImage.AlternateText = img.FileName; UploaderLabel.Text = img.Uploader; SubmissionDate.Text = img.SubmissionDate.ToString(); }
protected void rptPaging_ItemDataBound(object sender, DataListItemEventArgs e) { var lnkPage = (LinkButton)e.Item.FindControl("lbPaging"); if (lnkPage.CommandArgument != CurrentPage.ToString()) return; lnkPage.Enabled = false; lnkPage.BackColor = Color.FromName("#00FF00"); }
protected void lstPurchases_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Header) { } else if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataRowView dr = (DataRowView)e.Item.DataItem; HtmlInputCheckBox chkList = (HtmlInputCheckBox)e.Item.FindControl("chkList"); chkList.Value = dr["TransactionID"].ToString(); HyperLink lnkTransactionNo = (HyperLink)e.Item.FindControl("lnkTransactionNo"); lnkTransactionNo.Text = dr["TransactionNo"].ToString(); lnkTransactionNo.NavigateUrl = Constants.ROOT_DIRECTORY + "/Reports/Default.aspx?task=transaction&tranno=" + dr["TransactionNo"].ToString() + "&termno=" + dr["TerminalNo"].ToString() + "&branchid=" + dr["BranchID"].ToString(); Label lblTransactionDate = (Label)e.Item.FindControl("lblTransactionDate"); lblTransactionDate.Text = DateTime.Parse(dr["TransactionDate"].ToString()).ToString("dd-MMM-yyyy hh:mm tt"); Label lblCreditReason = (Label)e.Item.FindControl("lblCreditReason"); lblCreditReason.Text = dr["CreditReason"].ToString(); Label lblCredit = (Label)e.Item.FindControl("lblCredit"); lblCredit.Text = decimal.Parse(dr["Credit"].ToString()).ToString("#,##0.#0"); Label lblCreditPaid = (Label)e.Item.FindControl("lblCreditPaid"); lblCreditPaid.Text = decimal.Parse(dr["CreditPaid"].ToString()).ToString("#,##0.#0"); Label lblBalance = (Label)e.Item.FindControl("lblBalance"); lblBalance.Text = decimal.Parse(dr["Balance"].ToString()).ToString("#,##0.#0"); } }
private void lstDetalleItems_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { // Reviso si estoy en el detalle de items if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { // Estoy en el detalle de items // Obtengo los controles System.Web.UI.WebControls.Image imgNroPieza = (System.Web.UI.WebControls.Image)e.Item.FindControl("imgNroPieza"); Label lblDescripcion = (Label)e.Item.FindControl("lblDescripcion"); Label lblPesoEfectivo = (Label)e.Item.FindControl("lblPesoEfectivo"); Label lblPesoAforado = (Label)e.Item.FindControl("lblPesoAforado"); Label lblImporte = (Label)e.Item.FindControl("lblImporte"); // Cargo los controles if (((SisPacK.UC.ImprimirGuiaPreENB_Item)e.Item.DataItem).RepresentaUnBulto) { imgNroPieza.ImageUrl = "~/CB/" + ((SisPacK.UC.ImprimirGuiaPreENB_Item)e.Item.DataItem).CodigoBarra; } else { imgNroPieza.Visible = false; } lblDescripcion.Text = ((ImprimirGuiaPreENB_Item)e.Item.DataItem).Descripcion; lblPesoEfectivo.Text = ((ImprimirGuiaPreENB_Item)e.Item.DataItem).PesoEfectivo; lblPesoAforado.Text = ((ImprimirGuiaPreENB_Item)e.Item.DataItem).PesoAforado; lblImporte.Text = ((ImprimirGuiaPreENB_Item)e.Item.DataItem).Importe; } }
protected void DataListCateNews_ItemDataBound(object sender, DataListItemEventArgs e) { string Imgthumb = DataBinder.Eval(e.Item.DataItem, "ImageThumb").ToString(); Literal ltlImageThumb = (Literal)e.Item.FindControl("ltlImageThumb"); if (Imgthumb != "") ltlImageThumb.Text = @"<img src='" + ResolveUrl("~/") + "Upload/NewsGroup/NewsGroupThumb/" + Imgthumb + "' align='left' class='border_image' width='140' >"; }
protected void dlEmployee_ItemDataBound(object sender, DataListItemEventArgs e) { //tblEmployee emp = (tblEmployee)e.Item.DataItem; DataRowView drv = (DataRowView)e.Item.DataItem; DayPilotCalendar dpc = (DayPilotCalendar)e.Item.FindControl("DayPilotCalendar1"); if (ddlSearch.SelectedValue == "" || txtSearch.Text.Trim() == "") { //if (DateSelector1.DateValue != null) // dpc.StartDate = (DateTime)DateSelector1.DateValue; } else { if (ddlSearch.SelectedValue == "ID" && txtSearch.Text.Trim() != "") { long.TryParse(txtSearch.Text.Trim(), out BookID); dpc.StartDate = rh.getReservationDateByID(BookID); } else if (ddlSearch.SelectedValue == "Mobile" && txtSearch.Text.Trim() != "") { dpc.StartDate = rh.getReservationDateByMobile(txtSearch.Text.Trim()); } } //get Business Exclude Hours dpc.BusinessExcludeHours = rh.getBusinessExcludeHours(drv["employeeNum"].ToString(), dpc.StartDate); //bind data dpc.DataSource = rh.getReservation(drv["employeeNum"].ToString(), dpc.StartDate, dpc.Days); dpc.DataBind(); }
private void dlstVote_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem) { long voteId = System.Convert.ToInt64(this.dlstVote.DataKeys[e.Item.ItemIndex]); VoteInfo voteById = StoreHelper.GetVoteById(voteId); System.Collections.Generic.IList <VoteItemInfo> voteItems = StoreHelper.GetVoteItems(voteId); for (int i = 0; i < voteItems.Count; i++) { if (voteById.VoteCounts != 0) { voteItems[i].Percentage = decimal.Parse((voteItems[i].ItemCount / voteById.VoteCounts * 100m).ToString("F", System.Globalization.CultureInfo.InvariantCulture)); } else { voteItems[i].Percentage = 0m; } } System.Web.UI.WebControls.GridView view = (System.Web.UI.WebControls.GridView)e.Item.FindControl("grdVoteItem"); if (view != null) { view.DataSource = voteItems; view.DataBind(); } } }
protected void uiDataListSchedule_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { DataRowView row = (DataRowView)e.Item.DataItem; if (Convert.ToInt32(row["AirPlane"].ToString()) == 1) { HtmlGenericControl DivDetail = (HtmlGenericControl)e.Item.FindControl("Detail"); DivDetail.Attributes.CssStyle.Add("background-color","yellow"); DivDetail.Attributes.CssStyle.Add("color", "black"); } else { HtmlGenericControl DivDetail = (HtmlGenericControl)e.Item.FindControl("Detail"); DivDetail.Attributes.CssStyle.Add("background-color","green"); DivDetail.Attributes.CssStyle.Add("color", "white"); } CultureInfo ci = CultureInfo.InvariantCulture; Label company = (Label)e.Item.FindControl("uiLabelCompany"); Label CAA = (Label)e.Item.FindControl("uiLabelCAA"); Label DutyHours = (Label)e.Item.FindControl("uiLabelDutyHours"); TimeSpan Duty = new TimeSpan(); if (row["ChoxOff"] != null && row["ChoxOn"] != null && (DateTime.Parse(row["ChoxOn"].ToString()).Subtract(DateTime.Parse(row["ChoxOff"].ToString())) != TimeSpan.Zero)) { DateTime choxon = DateTime.Parse(row["ChoxOn"].ToString()); DateTime choxoff = DateTime.Parse(row["ChoxOff"].ToString()); Duty = choxon.Subtract(choxoff); } else { DateTime STD = DateTime.Parse(row["STD"].ToString()); DateTime STA = DateTime.Parse(row["STA"].ToString()); Duty = STA.Subtract(STD); } if (Companytotal == TimeSpan.Zero) { Companytotal = Duty; } else { Companytotal = Companytotal.Add(Duty); } if (DutyHoursTotal == TimeSpan.Zero) { DutyHoursTotal = Duty.Add(new TimeSpan(1, 30, 0)); } else { DutyHoursTotal = DutyHoursTotal.Add(Duty.Add(new TimeSpan(1, 30, 0))); } company.Text = Duty.ToString("hh\\:mm"); CAA.Text = company.Text; DutyHours.Text = Duty.Add(new TimeSpan(1,30,0)).ToString("hh\\:mm"); } }
private void dlstRefund_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem) { System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnCheckRefund"); System.Web.UI.WebControls.Label label = (System.Web.UI.WebControls.Label)e.Item.FindControl("lblHandleStatus"); System.Web.UI.HtmlControls.HtmlAnchor lkbtnReceive = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnReceive"); if (label.Text == "0") { label.Text = "待处理"; lkbtnReceive.Visible = true; return; } if (label.Text == "1") { label.Text = "已完成"; return; } else if (label.Text == "3") { htmlAnchor.Visible = true; label.Text = "已受理"; return; } if (label.Text == "2") { label.Text = "已拒绝"; return; } } }
private void lstGJournalsDebit_ItemDataBound(object sender, DataListItemEventArgs e) { if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataRowView dr = (DataRowView) e.Item.DataItem; Label lblChartOfAccountCodeDebit = (Label) e.Item.FindControl("lblChartOfAccountCodeDebit"); lblChartOfAccountCodeDebit.Text = dr["ChartOfAccountCode"].ToString(); Label lblChartOfAccountNameDebit = (Label) e.Item.FindControl("lblChartOfAccountNameDebit"); lblChartOfAccountNameDebit.Text = dr["ChartOfAccountName"].ToString(); Label lblDebitAmountDebit = (Label) e.Item.FindControl("lblDebitAmountDebit"); lblDebitAmountDebit.Text = Convert.ToDecimal(dr["Amount"].ToString()).ToString("#,##0.#0"); Label lblCreditAmountDebit = (Label) e.Item.FindControl("lblCreditAmountDebit"); lblCreditAmountDebit.Text = "0.00"; // //For anchor // HtmlGenericControl divExpCollAsst = (HtmlGenericControl) e.Item.FindControl("divExpCollAsst"); // // HtmlAnchor anchorDown = (HtmlAnchor) e.Item.FindControl("anchorDown"); // anchorDown.HRef = "javascript:ToggleDiv('" + divExpCollAsst.ClientID + "')"; } }
private void OnDataListBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { DataRowView drv = (DataRowView)e.Item.DataItem; if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { string mm = string.Format("{0:dd MMMM yyyy}", Convert.ToDateTime(drv.Row["OccupDateValue"].ToString())); string tt = mm.Substring(2, (mm.LastIndexOf(" ") - 2)); if (temp != string.Empty) { if (temp != tt) { DataListItem lItem = new DataListItem(e.Item.ItemIndex + 1, ListItemType.Item); //LiteralControl newLine = new LiteralControl("<tr style='background-color:black'></tr>"); //DataList1.Controls.Add(newLine); DataList1.Controls.Add(lItem); temp = string.Empty; } } if (temp == string.Empty) { temp = tt; } } }
protected void dlFlight_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { AirLeg airLeg = (AirLeg)(((System.Object)(((System.Web.UI.WebControls.DataListItem)(e.Item)).DataItem))); if (!string.IsNullOrEmpty(airLeg.OperatingAirlineInfo)) { ((Label)e.Item.FindControl("lblOperatingAirline")).Visible = true; ((Label)e.Item.FindControl("lblOperatingAirline")).Text = "Operated by: " + airLeg.OperatingAirlineInfo; //if (flightInfohider.IsNeedToHide(airCode, fareType)) //{ // ((Label)e.Item.FindControl("lblOperatingAirline")).Visible = false; // System.Web.UI.WebControls.Image imgCodeShared = (System.Web.UI.WebControls.Image)e.Item.Parent.Parent.FindControl("imgCodeShared"); // imgCodeShared.Visible = false; //} } else { ((Label)e.Item.FindControl("lblOperatingAirline")).Visible = false; } } }
protected void lstItem_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Header) { LoadSortFieldOptions(e); } else if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataRowView dr = (DataRowView)e.Item.DataItem; HtmlInputCheckBox chkList = (HtmlInputCheckBox)e.Item.FindControl("chkList"); chkList.Value = dr["DebitMemoID"].ToString(); POReturnStatus status = (POReturnStatus)Enum.Parse(typeof(POReturnStatus), dr["POReturnStatus"].ToString()); if (status == POReturnStatus.Posted || status == POReturnStatus.Cancelled) { chkList.Attributes.Add("disabled", "false"); } HyperLink lnkReturnNo = (HyperLink)e.Item.FindControl("lnkReturnNo"); lnkReturnNo.Text = dr["MemoNo"].ToString(); Common Common = new Common(); string stParam = "?task=" + Common.Encrypt("details", Session.SessionID) + "&retid=" + Common.Encrypt(chkList.Value.ToString(), Session.SessionID); lnkReturnNo.NavigateUrl = "Default.aspx" + stParam; Label lblReturnDate = (Label)e.Item.FindControl("lblReturnDate"); lblReturnDate.Text = Convert.ToDateTime(dr["MemoDate"]).ToString("yyyy-MM-dd HH:mm:ss"); Label lblSupplierID = (Label)e.Item.FindControl("lblSupplierID"); lblSupplierID.Text = dr["SupplierID"].ToString(); HyperLink lblSupplierCode = (HyperLink)e.Item.FindControl("lblSupplierCode"); lblSupplierCode.Text = dr["SupplierCode"].ToString(); stParam = "?task=" + Common.Encrypt("details", Session.SessionID) + "&id=" + Common.Encrypt(lblSupplierID.Text, Session.SessionID); lblSupplierCode.NavigateUrl = Constants.ROOT_DIRECTORY + "/PurchasesAndPayables/_Vendor/Default.aspx" + stParam; Label lblReqReturnDate = (Label)e.Item.FindControl("lblReqReturnDate"); lblReqReturnDate.Text = Convert.ToDateTime(dr["RequiredPostingDate"]).ToString("yyyy-MM-dd"); Label lblBranchID = (Label)e.Item.FindControl("lblBranchID"); lblBranchID.Text = dr["BranchID"].ToString(); Label lblBranchCode = (Label)e.Item.FindControl("lblBranchCode"); lblBranchCode.Text = dr["BranchCode"].ToString(); Label lblSubTotal = (Label)e.Item.FindControl("lblSubTotal"); lblSubTotal.Text = Convert.ToDecimal(dr["SubTotal"]).ToString("#,##0.#0"); Label lblRemarks = (Label)e.Item.FindControl("lblRemarks"); lblRemarks.Text = dr["Remarks"].ToString(); CheckBox chkIncludeIneSales = (CheckBox)e.Item.FindControl("chkIncludeIneSales"); chkIncludeIneSales.Checked = bool.Parse(dr["IncludeIneSales"].ToString()); //For anchor // HtmlGenericControl divExpCollAsst = (HtmlGenericControl) e.Item.FindControl("divExpCollAsst"); // HtmlAnchor anchorDown = (HtmlAnchor) e.Item.FindControl("anchorDown"); // anchorDown.HRef = "javascript:ToggleDiv('" + divExpCollAsst.ClientID + "')"; } }
protected void lstContent_ItemDataBound(System.Object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { string strContent = strTemplate; string strValue = Null.NullString; //add content to template if (Settings.Contains("template")) { strContent = (string)Settings["template"]; } ArrayList objProperties = CBO.GetPropertyInfo(typeof(ProductInfo)); int intProperty; foreach (PropertyInfo objPropertyInfo in objProperties) { if (strContent.IndexOf("[" + objPropertyInfo.Name.ToUpper() + "]") != -1) { strValue = Server.HtmlDecode(DataBinder.Eval(e.Item.DataItem, objPropertyInfo.Name).ToString()); strContent = strContent.Replace("[" + objPropertyInfo.Name.ToUpper() + "]", strValue); } } //assign the content Label lblContent = (Label)e.Item.FindControl("lblContent"); lblContent.Text = strContent; }
protected void dlArticle_ItemDataBound(object sender, DataListItemEventArgs e) { _currArticle = e.Item.DataItem as Article; this.Title = "Liveandev: " + _currArticle.Title; lnkCat.Text = _currArticle.CategoryTitle; lnkCat.NavigateUrl = "~/BrowseArticles.aspx?ID=" + _currArticle.CategoryID; lblAricleNotExist.Visible = false; if (_currArticle.OnlyForMembers && !this.User.Identity.IsAuthenticated) { panWholeContent.Visible = false; lblOnlyForMembers.Visible = true; } else { lblOnlyForMembers.Visible = false; if (!_currArticle.Published && !this.User.IsInRole("Administrators")) { panWholeContent.Visible = false; lblNotPublished.Visible = true; } else { lblNotPublished.Visible = false; panWholeContent.Visible = true; if (!this.IsPostBack) _currArticle.IncrementViewCount(); lblInsertComment.DataBind(); } } }
protected void dlDoctors_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataRowView drv = (DataRowView)e.Item.DataItem; //LinkButton lbtnDoctor = (LinkButton)e.Item.FindControl("lbtnDoctor"); Label lblDoctor = (Label)e.Item.FindControl("lblDoctor"); //Are we getting Health Grades details, or manually provided details? if (drv["DataSource"].ToString() == "Local") { //Local manually populated list: //lbtnDoctor.Text = drv["DoctorName"].ToString(); //lbtnDoctor.CommandName = "Select"; //lbtnDoctor.CommandArgument = drv["DoctorName"].ToString();//Will need something better than this probably. lblDoctor.Text = drv["DoctorName"].ToString(); } else { //Health Grades: //lbtnDoctor.Text = drv["LastName"].ToString() + ", " + drv["FirstName"].ToString() + " " + drv["Degree"].ToString(); //lbtnDoctor.CommandName = "Select"; //lbtnDoctor.CommandArgument = drv["ProviderID"].ToString() + "|" + drv["NPI"].ToString(); lblDoctor.Text = string.Format("{0}, {1} {2}", drv["LastName"], drv["FirstName"], drv["Degree"]); } } }
/// <summary> /// Handles the ItemDataBound event of the lstFAQs control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Web.UI.WebControls.DataListItemEventArgs" /> instance containing the event data.</param> protected void lstFAQs_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { FAQsInfo FaqItem = (FAQsInfo)e.Item.DataItem; string question = HtmlDecode(new FAQsController().ProcessTokens(FaqItem, this.QuestionTemplate)); Label lblAnswer = (Label)(e.Item.FindControl("A2")); try { if (SupportsClientAPI) // AJAX Mode { //change clientidmode, the old answerlabel still has the id from all categories. lblAnswer.ClientIDMode = ClientIDMode.Static; string answerID = string.Format("DNN_FAQ_{0}_{1}", ModuleId, FaqItem.ItemID); lblAnswer.ID = answerID; ((LinkButton)(e.Item.FindControl("lnkQ2"))).Visible = false; HtmlAnchor linkQuestion = (HtmlAnchor)(e.Item.FindControl("Q2")); linkQuestion.InnerHtml = question; // Utilize the ClientAPI to create ajax request string ClientCallBackRef = ClientAPI.GetCallbackEventReference(this, FaqItem.ItemID.ToString(), "GetFaqAnswerSuccess", "\'" + lblAnswer.ClientID + "\'", "GetFaqAnswerError"); //Set CallBackRef ClientScriptBlock string jsClientCallBackRef = string.Format("var ClientCallBackRef{0}= \"{1}\";", lblAnswer.ClientID, ClientCallBackRef); Page.ClientScript.RegisterClientScriptBlock(this.GetType(), string.Format("ClientCallBackRef{0}", lblAnswer.ClientID), jsClientCallBackRef, true); //Set LoadingTemplate ClientScriptBlock string jsLoadingTemplate = string.Format("var LoadingTemplate{0}= '{1}';", lblAnswer.ClientID, HtmlDecode(this.LoadingTemplate)); Page.ClientScript.RegisterClientScriptBlock(this.GetType(), string.Format("LoadingTemplate{0}", lblAnswer.ClientID), jsLoadingTemplate, true); //Define javascript action string AjaxJavaScript = "javascript: SetAnswerLabel('" + lblAnswer.ClientID + "');"; linkQuestion.Attributes.Add("onClick", AjaxJavaScript); } else // Postback Mode { ((HtmlAnchor)(e.Item.FindControl("Q2"))).Visible = false; LinkButton linkQuestion = (LinkButton)(e.Item.FindControl("lnkQ2")); linkQuestion.Text = question; } // If only one question (Requestparameter faqid) show answer immediately if (RequestFaqId > -1) { IncrementViewCount(FaqItem.ItemID); lblAnswer.Text = HtmlDecode(new FAQsController().ProcessTokens(FaqItem, this.AnswerTemplate)); } } catch (Exception exc) //Module failed to load { DotNetNuke.Services.Exceptions.Exceptions.ProcessModuleLoadException(this, exc); } } }
protected void DlManufacturers_OnItemDataBound(object sender, DataListItemEventArgs e) { if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { var manufacturer = e.Item.DataItem as Manufacturer; string manufacturerURL = SEOHelper.GetManufacturerUrl(manufacturer); var hlImageLink = e.Item.FindControl("hlImageLink") as HyperLink; if(hlImageLink != null) { hlImageLink.ImageUrl = this.PictureService.GetPictureUrl(manufacturer.PictureId, this.SettingManager.GetSettingValueInteger("Media.Manufacturer.ThumbnailImageSize", 125), true); hlImageLink.NavigateUrl = manufacturerURL; hlImageLink.ToolTip = String.Format(GetLocaleResourceString("Media.Manufacturer.ImageLinkTitleFormat"), manufacturer.LocalizedName); hlImageLink.Text = String.Format(GetLocaleResourceString("Media.Manufacturer.ImageAlternateTextFormat"), manufacturer.LocalizedName); } var hlManufacturer = e.Item.FindControl("hlManufacturer") as HyperLink; if(hlManufacturer != null) { hlManufacturer.NavigateUrl = manufacturerURL; hlManufacturer.ToolTip = String.Format(GetLocaleResourceString("Media.Manufacturer.ImageLinkTitleFormat"), manufacturer.LocalizedName); hlManufacturer.Text = Server.HtmlEncode(manufacturer.LocalizedName); } } }
public void dlstVote_ItemDataBound(object sender, DataListItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { long voteId = Convert.ToInt64(dlstVote.DataKeys[e.Item.ItemIndex]); VoteInfo voteById = StoreHelper.GetVoteById(voteId); IList<VoteItemInfo> voteItems = StoreHelper.GetVoteItems(voteId); for (int i = 0; i < voteItems.Count; i++) { if (voteById.VoteCounts != 0) { voteItems[i].Percentage = decimal.Parse((voteItems[i].ItemCount * 100M / voteById.VoteCounts).ToString("F", CultureInfo.InvariantCulture)); } else { voteItems[i].Percentage = 0M; } } GridView view = (GridView)e.Item.FindControl("grdVoteItem"); if (view != null) { view.DataSource = voteItems; view.DataBind(); } } }
void listaCat_dataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataRowView drv = (DataRowView)e.Item.DataItem; ((HyperLink)e.Item.FindControl("linkCat")).Text = drv["cat_nome"].ToString(); ((HyperLink)e.Item.FindControl("linkCat")).NavigateUrl = simplestecommerce.Category.linkforrouting((int)drv["cat_id"]); ((HtmlAnchor)e.Item.FindControl("linkImage")).HRef = simplestecommerce.Category.linkforrouting((int)drv["cat_id"]); Image img = (Image)e.Item.FindControl("imgCat"); if (drv["cat_img"].ToString()== "") img.ImageUrl = "~/immagini/non_disponibile.gif"; else img.ImageUrl = drv["cat_img"].ToString(); img.ToolTip = simplestecommerce.lingua.getforfrontendbypseudo(drv["cat_nome"].ToString()); } }
protected void lstItem_ItemDataBound(object sender, DataListItemEventArgs e) { if(e.Item.ItemType == ListItemType.Header) { LoadSortFieldOptions(e); } else if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataRowView dr = (DataRowView)e.Item.DataItem; ImageButton imgItemDelete = (ImageButton)e.Item.FindControl("imgItemDelete"); ImageButton imgItemEdit = (ImageButton)e.Item.FindControl("imgItemEdit"); HtmlInputCheckBox chkList = (HtmlInputCheckBox)e.Item.FindControl("chkList"); chkList.Value = dr["DepartmentID"].ToString(); imgItemDelete.Enabled = cmdDelete.Visible; if (!imgItemDelete.Enabled) imgItemDelete.ImageUrl = Constants.ROOT_DIRECTORY + "/_layouts/images/blank.gif"; imgItemEdit.Enabled = cmdEdit.Visible; if (!imgItemEdit.Enabled) imgItemEdit.ImageUrl = Constants.ROOT_DIRECTORY + "/_layouts/images/blank.gif"; if (imgItemDelete.Enabled) imgItemDelete.Attributes.Add("onClick", "return confirm_item_delete();"); Label lblDepartmentCode = (Label)e.Item.FindControl("lblDepartmentCode"); lblDepartmentCode.Text = dr["DepartmentCode"].ToString(); HyperLink lnkDepartmentName = (HyperLink)e.Item.FindControl("lnkDepartmentName"); lnkDepartmentName.Text = dr["DepartmentName"].ToString(); lnkDepartmentName.NavigateUrl = "Default.aspx?task=" + Common.Encrypt("details", Session.SessionID) + "&id=" + Common.Encrypt(chkList.Value, Session.SessionID); } }
protected void enablebutton(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { System.Data.DataRowView drv = (System.Data.DataRowView)(e.Item.DataItem); int quantity = int.Parse(drv.Row["expr2"].ToString()); if (quantity == 0) { DataList3.Controls[0].FindControl("Label1").Visible = false; DataList3.Controls[0].FindControl("textboxprix").Visible = false; DataList3.Controls[0].FindControl("buttonb").Visible = false; DataList3.Controls[0].FindControl("nodisp").Visible = true; // DataList3.Items.Controls[1].Visible = false; } else { DataList3.Controls[0].FindControl("Label1").Visible = true; DataList3.Controls[0].FindControl("textboxprix").Visible = true; DataList3.Controls[0].FindControl("buttonb").Visible = true; DataList3.Controls[0].FindControl("nodisp").Visible = false; } } }
protected void DataListSzczegoly2_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.DataItem != null) { suma += Decimal.Parse(((DataRowView)e.Item.DataItem)["ilosc"].ToString()) * Decimal.Parse(((DataRowView)e.Item.DataItem)["cena"].ToString()); } }
protected void dlEmployee_ItemDataBound(object sender, DataListItemEventArgs e) { DropDownList ddlcheckin, ddlcheckout; ddlcheckin = (DropDownList)e.Item.FindControl("ddlCheckIn"); ddlcheckout = (DropDownList)e.Item.FindControl("ddlCheckOut"); //default value CommonUtil.SetDropDownSelectedByText(ddlcheckin, "11:00"); CommonUtil.SetDropDownSelectedByText(ddlcheckout, "19:30"); CheckBox chkIsLeave; TextBox txtAnnual, txtSick, txtOther; chkIsLeave = (CheckBox)e.Item.FindControl("chkIsLeave"); txtAnnual = (TextBox)e.Item.FindControl("txtAnnualLeave"); txtSick = (TextBox)e.Item.FindControl("txtSickLeave"); txtOther = (TextBox)e.Item.FindControl("txtOtherLeave"); //check db saved data vw_Employee emp = (vw_Employee)e.Item.DataItem; DataTable dt=eh.getReservationTime(emp.employeeNum, (DateTime)DateSelector1.DateValue); if (dt != null && dt.Rows.Count == 1) { CommonUtil.SetDropDownSelectedByText(ddlcheckin, dt.Rows[0]["checkinTime"].ToString()); CommonUtil.SetDropDownSelectedByText(ddlcheckout, dt.Rows[0]["checkoutTime"].ToString()); chkIsLeave.Checked = (bool)dt.Rows[0]["isLeave"]; txtAnnual.Text = dt.Rows[0]["AnnualLeave"].ToString(); txtSick.Text = dt.Rows[0]["SickLeave"].ToString(); txtOther.Text = dt.Rows[0]["OtherLeave"].ToString(); } }
protected void lstAccessCategory_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataRowView dr = (DataRowView)e.Item.DataItem; Label lblCategory = (Label)e.Item.FindControl("lblCategory"); lblCategory.Text = dr["Category"].ToString(); DataList lstItem = (DataList)e.Item.FindControl("lstItem"); if (cboGroup.ToolTip == "1") //check if load from cboGroup_SelectedIndexChanged { AccessGroupRights clsAccessGroupRights = new AccessGroupRights(); lstItem.DataSource = clsAccessGroupRights.DataList(lblCategory.Text, int.Parse(cboGroup.SelectedValue), "Category, SequenceNo", SortOption.Ascending).DefaultView; clsAccessGroupRights.CommitAndDispose(); } else { AccessRights clsAccessRights = new AccessRights(); lstItem.DataSource = clsAccessRights.DataList(lblCategory.Text, long.Parse(lblUID.Text), "Category, SequenceNo", SortOption.Ascending).DefaultView; clsAccessRights.CommitAndDispose(); } lstItem.DataBind(); } }
protected void dlChild2_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { CheckBox ChkIsAdd = (CheckBox)e.Item.FindControl("ChkIsAdd"); HtmlTableCell objIsadd = (HtmlTableCell)e.Item.FindControl("tdIsAdd"); if (ChkIsAdd.Visible == false) { objIsadd.InnerHtml = "NA"; } CheckBox ChkIsEdit = (CheckBox)e.Item.FindControl("ChkIsEdit"); HtmlTableCell objIsEdit = (HtmlTableCell)e.Item.FindControl("tdIsEdit"); if (ChkIsEdit.Visible == false) { objIsEdit.InnerHtml = "NA"; } CheckBox ChkIsDelete = (CheckBox)e.Item.FindControl("ChkIsDelete"); HtmlTableCell objIsDelete = (HtmlTableCell)e.Item.FindControl("tdIsDelete"); if (ChkIsDelete.Visible == false) { objIsDelete.InnerHtml = "NA"; } }
protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { // Retrieve the Label control in the current DataListItem. Label PriceLabel = (Label)e.Item.FindControl("lblPrice"); Label ProductIdLabel = (Label)e.Item.FindControl("lblProductId"); Label NameLabel = (Label)e.Item.FindControl("lblName"); Label RatingLabel = (Label)e.Item.FindControl("lblRating"); Label totalPrice = (Label)e.Item.FindControl("lblAmtVoted"); Label DetailsLabel = (Label)e.Item.FindControl("lblDetails"); TextBox Quantity = (TextBox)e.Item.FindControl("txtQuantity"); Decimal Price = Convert.ToDecimal(((DataRowView)e.Item.DataItem).Row.ItemArray[2].ToString()); int ID = Convert.ToInt32(((DataRowView)e.Item.DataItem).Row.ItemArray[0].ToString()); string Name = (((DataRowView)e.Item.DataItem).Row.ItemArray[1].ToString()).Replace('"', ' '); int Qty = Convert.ToInt32(((DataRowView)e.Item.DataItem).Row.ItemArray[3].ToString()); Decimal Total = Convert.ToDecimal(((DataRowView)e.Item.DataItem).Row.ItemArray[4].ToString()); PriceLabel.Text = Price.ToString("c"); ProductIdLabel.Text = ID.ToString(); NameLabel.Text = Name; totalPrice.Text = Total.ToString("c"); Quantity.Text = Qty.ToString(); } }
protected void DataListSzukaj_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.DataItem == null) return; int ilosc = Int32.Parse(((DataRowView)e.Item.DataItem)["ilosc"].ToString()); if (ilosc < 1) ((Button)e.Item.FindControl("ButtonDoKoszyka")).Enabled = false; MySqlConnection conn; MySqlCommand cmd; MySqlDataReader rdr; MySqlParameter param; conn = new MySqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["CS"].ConnectionString); conn.Open(); cmd = new MySqlCommand("SELECT obrazek FROM produkty_obrazki WHERE produktID = @produktID LIMIT 1;"); cmd.Connection = conn; param = new MySqlParameter("produktID", MySqlDbType.Int32); param.Value = ((DataRowView)e.Item.DataItem)["produktID"].ToString(); cmd.Parameters.Add(param); rdr = cmd.ExecuteReader(); while (rdr.Read()) { ((Image)e.Item.FindControl("ImageObrazek")).ImageUrl = "~/images/products/" + ((DataRowView)e.Item.DataItem)["produktID"].ToString() + "/" + rdr.GetString(rdr.GetOrdinal("obrazek")); } conn.Close(); }
private void dlstOrderItems_ItemDataBound(object sender, DataListItemEventArgs e) { SiteSettings siteSettings = SettingsManager.GetSiteSettings(HiContext.Current.User.UserId); if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { HyperLink link = (HyperLink)e.Item.FindControl("hpkBuyToSend"); HyperLink link2 = (HyperLink)e.Item.FindControl("hpkBuyDiscount"); Literal literal = (Literal)e.Item.FindControl("litPurchaseGiftId"); Literal literal2 = (Literal)e.Item.FindControl("litWholesaleDiscountId"); if (!string.IsNullOrEmpty(literal.Text)) { link.NavigateUrl = "http://" + siteSettings.SiteUrl + Globals.ApplicationPath + string.Format("/FavourableDetails.aspx?activityId={0}", literal.Text); } if (!string.IsNullOrEmpty(literal2.Text)) { link2.NavigateUrl = "http://" + siteSettings.SiteUrl + Globals.ApplicationPath + string.Format("/FavourableDetails.aspx?activityId={0}", literal2.Text); } } }
protected void dlAlsoPurchasedProducts_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { var product = e.Item.DataItem as Product; if (product != null) { string productURL = SEOHelper.GetProductUrl(product); var hlImageLink = e.Item.FindControl("hlImageLink") as HyperLink; if (hlImageLink != null) { var picture = product.DefaultPicture; if (picture != null) hlImageLink.ImageUrl = PictureManager.GetPictureUrl(picture, SettingManager.GetSettingValueInteger("Media.Product.ThumbnailImageSize", 125), true); else hlImageLink.ImageUrl = PictureManager.GetDefaultPictureUrl(SettingManager.GetSettingValueInteger("Media.Product.ThumbnailImageSize", 125)); hlImageLink.NavigateUrl = productURL; hlImageLink.ToolTip = String.Format(GetLocaleResourceString("Media.Product.ImageLinkTitleFormat"), product.LocalizedName); hlImageLink.Text = String.Format(GetLocaleResourceString("Media.Product.ImageAlternateTextFormat"), product.LocalizedName); } var hlProduct = e.Item.FindControl("hlProduct") as HyperLink; if (hlProduct != null) { hlProduct.NavigateUrl = productURL; hlProduct.Text = product.LocalizedName; } } } }
void dataListCat_dataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataRowView drv = (DataRowView)e.Item.DataItem; simplestecommerce.Listino Currentlistino = ((simplestecommerce.Cart)Session["Cart"]).Listino; simplestecommerce.User Currentuser = ((simplestecommerce.Cart)Session["Cart"]).User; simplestecommerce.articolo articolo = new articolo((int)drv["art_id"], Currentlistino.Id, Currentlistino.Sconto, Currentuser.Sconto); l += 1; if ((Math.Ceiling((double)l / 2) == Convert.ToDouble(l / 2))) { //((HtmlTableCell)e.Item.FindControl("td1")).Width= "14"; } if (l == 1) { // ((HtmlTableCell)e.Item.FindControl("td2")).Attributes["style"] = "background-color:#ffffff; border-bottom: dotted 1px #BDCDD9; border-top: dotted 1px #BDCDD9"; // ((HtmlTableCell)e.Item.FindControl("td3")).Attributes["style"] = "background-color:#ffffff; border-bottom: dotted 1px #BDCDD9; border-top: dotted 1px #BDCDD9"; } else if (l > 2) { ((HtmlTableCell)e.Item.FindControl("td2")).Attributes["style"] = "background-color:#ffffff; border-top: dotted 1px #BDCDD9;"; ((HtmlTableCell)e.Item.FindControl("td3")).Attributes["style"] = "background-color:#ffffff; border-top: dotted 1px #BDCDD9;"; } ((HyperLink)e.Item.FindControl("hLinkArt")).Text = simplestecommerce.lingua.getforfrontendfromdb( articolo.Name ); ((HyperLink)e.Item.FindControl("hLinkArt")).NavigateUrl = articolo.Linkart; ((HtmlAnchor)e.Item.FindControl("linkImage")).HRef = articolo.Linkart; Image img = (Image)e.Item.FindControl("imgArt"); if (articolo.Preview == "") img.ImageUrl = "~/immagini/non_disponibile.gif"; else img.ImageUrl = articolo.Preview; img.ToolTip = simplestecommerce.lingua.getforfrontendfromdb( articolo.Name); Label lblPrezzoArticolo = ((Label)e.Item.FindControl("lblPrezzoArticolo")); lblPrezzoArticolo.Text = currencies.tostrusercurrency(articolo.Prezzodoposcontoprodottoutentelistino); } }
/* This sets up the list of records */ protected void viewDataList_ItemDataBound(object sender, DataListItemEventArgs e) { SpeakerFeeDTO myDTO = (SpeakerFeeDTO)e.Item.DataItem; TextBox viewAmountTxtBox = (TextBox)e.Item.FindControl("viewAmountTxtBox"); DropDownList viewFeeScheduleTypeDDL = (DropDownList)e.Item.FindControl("viewFeeScheduleTypeDDL"); DropDownList viewContractTypeDDL = (DropDownList)e.Item.FindControl("viewContractTypeDDL"); DropDownList viewGroupDDL = (DropDownList)e.Item.FindControl("viewGroupDDL"); DropDownList viewRoleDDL = (DropDownList)e.Item.FindControl("viewRoleDDL"); TextBox viewStartDateTxtBox = (TextBox)e.Item.FindControl("viewStartDateTxtBox"); TextBox viewEndDateTxtBox = (TextBox)e.Item.FindControl("viewEndDateTxtBox"); Button viewEditBtn = (Button)e.Item.FindControl("viewEditBtn"); Button viewSaveBtn = (Button)e.Item.FindControl("viewSaveBtn"); Button viewDeleteBtn = (Button)e.Item.FindControl("viewDeleteBtn"); viewAmountTxtBox.Text = myDTO.Amount.ToString(); viewAmountTxtBox.Enabled = false; viewFeeScheduleTypeDDL.DataSource = GetFeeScheduleTypeIds(); viewFeeScheduleTypeDDL.DataTextField = "Key"; viewFeeScheduleTypeDDL.DataValueField = "Value"; viewFeeScheduleTypeDDL.DataBind(); viewFeeScheduleTypeDDL.SelectedValue = myDTO.FeeScheduleTypeID.ToString(); viewFeeScheduleTypeDDL.Enabled = false; viewContractTypeDDL.DataSource = GetContractTypeIds(); viewContractTypeDDL.DataTextField = "Key"; viewContractTypeDDL.DataValueField = "Value"; viewContractTypeDDL.DataBind(); viewContractTypeDDL.SelectedValue = myDTO.ContractTypeID.ToString(); viewContractTypeDDL.Enabled = false; viewGroupDDL.DataSource = GetSpeakerFeeGroupIds(); viewGroupDDL.DataTextField = "Key"; viewGroupDDL.DataValueField = "Value"; viewGroupDDL.DataBind(); viewGroupDDL.SelectedValue = myDTO.SpeakerFeeGroupId.ToString(); viewGroupDDL.Enabled = false; viewRoleDDL.DataSource = GetSpeakerRoleIds(); viewRoleDDL.DataTextField = "Key"; viewRoleDDL.DataValueField = "Value"; viewRoleDDL.DataBind(); viewRoleDDL.SelectedValue = myDTO.SpeakerRoleID.ToString(); viewRoleDDL.Enabled = false; viewStartDateTxtBox.Text = myDTO.StartDate.ToShortDateString(); viewStartDateTxtBox.Enabled = false; viewEndDateTxtBox.Text = myDTO.EndDate.ToShortDateString(); viewEndDateTxtBox.Enabled = false; viewSaveBtn.Visible = false; viewSaveBtn.CommandArgument = viewSaveBtn.ClientID; viewDeleteBtn.Visible = false; viewDeleteBtn.CommandArgument = viewDeleteBtn.ClientID; viewEditBtn.Visible = true; viewEditBtn.CommandArgument = viewEditBtn.ClientID; }
protected void DataList3_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { DataRowView rowView = (DataRowView)e.Item.DataItem; ((ImageButton)(e.Item.FindControl("cover"))).ImageUrl = "../upload/mov/" + rowView["filename"].ToString().Replace(".flv", ".jpg"); ((ImageButton)(e.Item.FindControl("cover"))).Attributes.Add("OnClick", "return selectavi(this.src, '" + rowView["uploadid"].ToString() + "')"); }
protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e) { LinkButton dele = (LinkButton)(e.Item.FindControl("lbtnDelete")); if (dele != null) { dele.Attributes.Add("onclick", "return confirm('确定删除吗?')"); } }
protected void dlHotel_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { //HyperLink hotelSelect = (HyperLink)e.Item.FindControl("hotelSelect"); //hotelSelect.NavigateUrl += "&ConditionID=" + Request.Params["ConditionID"]; } }
protected void DataListSubOrder_RowDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataList DataListSubOrder = (DataList)sender; string strSubOrderId = DataListSubOrder.DataKeys[e.Item.ItemIndex].ToString(); } }
protected void dtlCategorias_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType != ListItemType.Header && e.Item.ItemType != ListItemType.Footer) { ((HyperLink)e.Item.FindControl("lnkCategoria")).Text = ((CATEGORIA)e.Item.DataItem).NOME; ((HyperLink)e.Item.FindControl("lnkCategoria")).NavigateUrl = "Produtos.aspx?categoria=" + ((CATEGORIA)e.Item.DataItem).IDT_CATEGORIA.ToString(); } }
protected void dtlFabricantes_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType != ListItemType.Header && e.Item.ItemType != ListItemType.Footer) { ((HyperLink)e.Item.FindControl("lnkFabricante")).Text = ((FABRICANTE)e.Item.DataItem).NOME; ((HyperLink)e.Item.FindControl("lnkFabricante")).NavigateUrl = "Produtos.aspx?fabricante=" + ((FABRICANTE)e.Item.DataItem).IDT_FABRICANTE.ToString(); } }
private void dlstPurchaseOrders_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem) { System.Web.UI.WebControls.Label label = (System.Web.UI.WebControls.Label)e.Item.FindControl("lkbtnSendGoods"); object obj = System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway"); string a = ""; if (obj != null && !(obj is System.DBNull)) { a = obj.ToString(); } ImageLinkButton imageLinkButton = (ImageLinkButton)e.Item.FindControl("lkbtnConfirmPurchaseOrder"); System.Web.UI.HtmlControls.HtmlGenericControl htmlGenericControl = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Item.FindControl("lkbtnEditPurchaseOrder"); System.Web.UI.WebControls.Literal literal = (System.Web.UI.WebControls.Literal)e.Item.FindControl("litClosePurchaseOrder"); ImageLinkButton imageLinkButton2 = (ImageLinkButton)e.Item.FindControl("lkbtnPayOrder"); OrderStatus orderStatus = (OrderStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "PurchaseStatus"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnCheckPurchaseRefund"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor2 = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnCheckPurchaseReturn"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor3 = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnCheckPurchaseReplace"); ImageLinkButton imageLinkButton3 = (ImageLinkButton)e.Item.FindControl("lkbtnOrderMatch"); if (orderStatus == OrderStatus.WaitBuyerPay) { literal.Visible = true; htmlGenericControl.Visible = true; if (a != "hishop.plugins.payment.podrequest") { imageLinkButton2.Visible = true; } } if (orderStatus == OrderStatus.BuyerAlreadyPaid || (orderStatus == OrderStatus.WaitBuyerPay && a == "hishop.plugins.payment.podrequest")) { imageLinkButton3.Visible = true; } if (orderStatus == OrderStatus.ApplyForRefund) { htmlAnchor.Visible = true; } if (orderStatus == OrderStatus.ApplyForReturns) { htmlAnchor2.Visible = true; } if (orderStatus == OrderStatus.ApplyForReplacement) { htmlAnchor3.Visible = true; } string purchaseOrderId = this.dlstPurchaseOrders.DataKeys[e.Item.ItemIndex].ToString(); SalesHelper.GetPurchaseOrder(purchaseOrderId); label.Visible = (orderStatus == OrderStatus.BuyerAlreadyPaid || (orderStatus == OrderStatus.WaitBuyerPay && a == "hishop.plugins.payment.podrequest")); imageLinkButton.Visible = (orderStatus == OrderStatus.SellerAlreadySent); string orderid = (string)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "PurchaseOrderId"); if (Methods.Supplier_ShipOrderHasAllSendGood(orderid) && orderStatus == OrderStatus.SellerAlreadySent) { imageLinkButton.Visible = true; return; } imageLinkButton.Visible = false; } }
protected void DataList1_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { // Dim img As Image = CType(e.Item.FindControl("mypic"), Image) ImageButton img = ((ImageButton)(e.Item.FindControl("mypic"))); DataRowView rowView = (DataRowView )e.Item.DataItem; img.ImageUrl = "../upload/pic/" + rowView["filename"].ToString(); image1.ImageUrl = "../upload/pic/" + rowView["filename"].ToString(); }
private void dlstOrders_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem) { OrderStatus orderStatus = (OrderStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderStatus"); System.Web.UI.WebControls.Label label = (System.Web.UI.WebControls.Label)e.Item.FindControl("lkbtnSendGoods"); label.Visible = (orderStatus == OrderStatus.BuyerAlreadyPaid); } }
private void dlstPurchaseOrders_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem) { System.Web.UI.WebControls.HyperLink hyperLink = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("lkbtnPay"); System.Web.UI.WebControls.HyperLink hyperLink2 = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("lkbtnSendGoods"); System.Web.UI.HtmlControls.HtmlGenericControl htmlGenericControl = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Item.FindControl("lkBtnCancelPurchaseOrder"); ImageLinkButton imageLinkButton = (ImageLinkButton)e.Item.FindControl("lkbtnConfirmPurchaseOrder"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForPurchaseRefund"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor2 = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForPurchaseReturn"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor3 = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForPurchaseReplace"); OrderStatus orderStatus = (OrderStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "PurchaseStatus"); string orderId = (string)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderId"); System.Web.UI.WebControls.Literal literal = (System.Web.UI.WebControls.Literal)e.Item.FindControl("litPayment"); if (orderStatus == OrderStatus.SellerAlreadySent) { OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(orderId); if (orderInfo != null && orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid) { hyperLink2.Visible = true; } else { imageLinkButton.Visible = true; } htmlAnchor2.Visible = true; htmlAnchor3.Visible = true; } if (orderStatus == OrderStatus.WaitBuyerPay) { hyperLink.Visible = true; htmlGenericControl.Visible = true; if (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway") != System.DBNull.Value && "hishop.plugins.payment.podrequest" == (string)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway")) { hyperLink.Visible = false; } } if (orderStatus == OrderStatus.BuyerAlreadyPaid) { htmlAnchor.Visible = true; } string purchaseOrderId = this.dlstPurchaseOrders.DataKeys[e.Item.ItemIndex].ToString(); PurchaseOrderInfo purchaseOrder = SubsiteSalesHelper.GetPurchaseOrder(purchaseOrderId); if (string.IsNullOrEmpty(purchaseOrder.PaymentType)) { if (orderStatus == OrderStatus.BuyerAlreadyPaid) { literal.Text = "<br>支付方式:预付款"; return; } } else { literal.Text = "<br>支付方式:" + purchaseOrder.PaymentType; } } }
protected void MyList_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item | e.Item.ItemType == ListItemType.AlternatingItem) { int id = int.Parse(((Label)e.Item.FindControl("lbl_id")).Text); HyperLink lnk_detail = (HyperLink)e.Item.FindControl("lnk_detail"); lnk_detail.NavigateUrl = Config.GetUrl("adm/sc/Log/ViewErrorDetail.aspx?id=" + id); } }
protected void dlContents_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (Convert.ToInt32(Session["IsStudent"]) == 1 && Convert.ToBoolean(Session["IsAllowEdit"]) == false) { LinkButton lnkEdit = (LinkButton)e.Item.FindControl("lnkEdit"); lnkEdit.Visible = false; LinkButton lnkDelete = (LinkButton)e.Item.FindControl("lnkDelete"); lnkDelete.Visible = false; } }
protected void dlChild_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item | e.Item.ItemType == ListItemType.AlternatingItem) { CheckBox ChkIsAdd = (CheckBox)e.Item.FindControl("ChkIsAdd"); HtmlTableCell objIsadd = (HtmlTableCell)e.Item.FindControl("tdIsAdd"); if (ChkIsAdd.Visible == false) { objIsadd.InnerHtml = "NA"; } CheckBox ChkIsEdit = (CheckBox)e.Item.FindControl("ChkIsEdit"); HtmlTableCell objIsEdit = (HtmlTableCell)e.Item.FindControl("tdIsEdit"); if (ChkIsEdit.Visible == false) { objIsEdit.InnerHtml = "NA"; } CheckBox ChkIsDelete = (CheckBox)e.Item.FindControl("ChkIsDelete"); HtmlTableCell objIsDelete = (HtmlTableCell)e.Item.FindControl("tdIsDelete"); if (ChkIsDelete.Visible == false) { objIsDelete.InnerHtml = "NA"; } DataList dlChild = (DataList)e.Item.Parent; DataList dl = (DataList)e.Item.FindControl("dlChild2"); DataTable dt = new DataTable(); if (string.IsNullOrEmpty(hdnPKID.Value)) { if ((bool)Session[appFunctions.Session.IsSuperAdmin.ToString()] == true) { dt = objRole.LoadPermissionTab(0.ToString(), dlChild.DataKeys[e.Item.ItemIndex].ToString(), "", (bool)Session[appFunctions.Session.IsSuperAdmin.ToString()]); } else { dt = objRole.LoadPermissionTab(Session[appFunctions.Session.RoleID.ToString()].ToString(), dlChild.DataKeys[e.Item.ItemIndex].ToString(), "", (bool)Session[appFunctions.Session.IsSuperAdmin.ToString()]); } } else { if ((bool)Session[appFunctions.Session.IsSuperAdmin.ToString()] == true) { dt = objRole.LoadPermissionTab(hdnPKID.Value, dlChild.DataKeys[e.Item.ItemIndex].ToString(), "", (bool)Session[appFunctions.Session.IsSuperAdmin.ToString()]); } else { dt = objRole.LoadPermissionTab(Session[appFunctions.Session.RoleID.ToString()].ToString(), dlChild.DataKeys[e.Item.ItemIndex].ToString(), "", (bool)Session[appFunctions.Session.IsSuperAdmin.ToString()], hdnPKID.Value); } } dl.DataSource = dt; dl.DataBind(); } }
protected void DltEvaluacion_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { var campoid = e.Item.FindControl("campoid") as Label; var dtlHijos = e.Item.FindControl("DtlHijos") as DataList; if (CodigoAspecto != 6) { if (dtlHijos != null) { if (campoid != null) { dtlHijos.DataSource = LoadDatosEvaluacionAspectos(campoid.Text); } dtlHijos.DataBind(); } } else { DltEvaluacion.ShowHeader = false; DltEvaluacion.ShowFooter = false; if (dtlHijos != null) { if (campoid != null) { dtlHijos.DataSource = LoadDatosEvaluacionAspectos(campoid.Text); } dtlHijos.DataBind(); } } } else if (e.Item.ItemType == ListItemType.Footer) { var lpuntaje = e.Item.FindControl("lpuntajeObtenido") as Label; if (CodigoAspecto != 6) { if (lpuntaje != null) { lpuntaje.Text = Convert.ToString(Puntaje); } } else { if (lpuntaje != null) { lpuntaje.Visible = false; } } } }
private void dItems_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { string s = String.Empty; string iPath = String.Empty; string imageName = String.Empty; if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { HyperLink hl = (HyperLink)(e.Item.FindControl("hlAddItem")); //hl.NavigateUrl = hl.NavigateUrl + "&backURL=" + ViewState["backURL"].ToString(); if (blIsLoggedIn) { hl.Visible = true; } else { hl.Visible = false; } System.Web.UI.WebControls.Image i = (System.Web.UI.WebControls.Image)(e.Item.FindControl("image1")); s = mDataSet.Tables[mMain.sProductSource].Rows[e.Item.ItemIndex]["Image1"].ToString(); imageName = s.Substring(s.LastIndexOf("/") + 1); iPath = "~/images/Products/" + imageName; MemoryStream ms = null; Bitmap bm = null; try { if (!string.IsNullOrEmpty(iPath)) { //if (File.Exists(iPath)) //{ ms = new MemoryStream(); ImageBuilder.Current.Build(iPath, ms, new ResizeSettings("width=200&height=200&&mode=pad&bgcolor=black"), true); bm = new Bitmap(ms); i.ImageUrl = BitmapToEmbedded(bm); //} } } catch (Exception ex) { string err = ex.Message; } finally { ms.Flush(); ms.Dispose(); bm = null; } } }
private void dlstOrderItems_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { Hidistro.Membership.Context.SettingsManager.GetSiteSettings(Hidistro.Membership.Context.HiContext.Current.User.UserId); if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem) { System.Web.UI.WebControls.HyperLink arg_46_0 = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("hpkBuyToSend"); System.Web.UI.WebControls.HyperLink arg_5C_0 = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("hpkBuyDiscount"); System.Web.UI.WebControls.Literal arg_72_0 = (System.Web.UI.WebControls.Literal)e.Item.FindControl("litPurchaseGiftId"); System.Web.UI.WebControls.Literal arg_88_0 = (System.Web.UI.WebControls.Literal)e.Item.FindControl("litWholesaleDiscountId"); } }
private void lstBultosEnLaGuia_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { // Reviso si estoy en el detalle de items if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { // Estoy en el detalle de items. // Busco los controles System.Web.UI.WebControls.Image imgCodigoBarra = (System.Web.UI.WebControls.Image)e.Item.FindControl("imgCodigoBarra"); // Cargo los controles imgCodigoBarra.ImageUrl = "~/CB/NAC" + ((SisPacK.UC.ImprimirGuiaPreENB_Item)e.Item.DataItem).CodigoBarra; } }
protected void AddressList_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item | e.Item.ItemType == ListItemType.AlternatingItem) { System.Web.UI.WebControls.Label AddressDisplay; AddressDisplay = (Label)e.Item.FindControl("AddressDisplay"); if (AddressDisplay != null) { AddressDisplay.Text = ((Address)e.Item.DataItem).ToHtmlString(); } } }
protected void ProductList_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { Product product = (Product)e.Item.DataItem; // HIDE THE QUANTITY OPTIONS WHEN PRODUCT HAVE CHOICES OR STORE IS IN CATALOG MODE Control QuantityPanel = (Control)e.Item.FindControl("QuantityPanel"); QuantityPanel.Visible = !product.HasChoices && !product.DisablePurchase && !product.IsSubscription && !AbleContext.Current.Store.Settings.ProductPurchasingDisabled; _quantityVisible = _quantityVisible || QuantityPanel.Visible; } }
protected void DataListSubOrder_RowDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataList DataListSubOrder = (DataList)sender; string strSubOrderId = DataListSubOrder.DataKeys[e.Item.ItemIndex].ToString(); HiddenField hdnStatus = (HiddenField)e.Item.FindControl("hdnStatus"); HiddenField hdnOrderId = (HiddenField)e.Item.FindControl("hdnOrderId"); HiddenField hdnReturnStatus = (HiddenField)e.Item.FindControl("hdnReturnStatus"); HiddenField hdnDocketNo = (HiddenField)e.Item.FindControl("hdnDocketNo"); } }
private void dlstPurchaseOrders_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem) { System.Web.UI.HtmlControls.HtmlGenericControl htmlGenericControl = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Item.FindControl("lkbtnClosePurchaseOrder"); System.Web.UI.WebControls.HyperLink hyperLink = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("lkbtnPay"); ImageLinkButton imageLinkButton = (ImageLinkButton)e.Item.FindControl("lkbtnConfirmPurchaseOrder"); System.Web.UI.WebControls.Literal literal = (System.Web.UI.WebControls.Literal)e.Item.FindControl("litTbOrderDetailLink"); System.Web.UI.WebControls.Literal literal2 = (System.Web.UI.WebControls.Literal)e.Item.FindControl("litPayment"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForPurchaseRefund"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor2 = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForPurchaseReturn"); System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor3 = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForPurchaseReplace"); OrderStatus orderStatus = (OrderStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "PurchaseStatus"); if (orderStatus == OrderStatus.WaitBuyerPay) { htmlGenericControl.Visible = true; if (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway") == System.DBNull.Value || "hishop.plugins.payment.podrequest" != (string)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway")) { hyperLink.Visible = true; } } if (orderStatus == OrderStatus.BuyerAlreadyPaid) { htmlAnchor.Visible = true; } if (orderStatus == OrderStatus.SellerAlreadySent) { htmlAnchor2.Visible = true; htmlAnchor3.Visible = true; } string purchaseOrderId = this.dlstPurchaseOrders.DataKeys[e.Item.ItemIndex].ToString(); PurchaseOrderInfo purchaseOrder = SubsiteSalesHelper.GetPurchaseOrder(purchaseOrderId); if (string.IsNullOrEmpty(purchaseOrder.PaymentType)) { if (orderStatus == OrderStatus.BuyerAlreadyPaid) { literal2.Text = "<br>支付方式:预付款"; } } else { literal2.Text = "<br>支付方式:" + purchaseOrder.PaymentType; } imageLinkButton.Visible = (orderStatus == OrderStatus.SellerAlreadySent); object obj = System.Web.UI.DataBinder.Eval(e.Item.DataItem, "TaobaoOrderId"); if (obj != null && obj != System.DBNull.Value && obj.ToString().Length > 0) { literal.Text = string.Format("<a target=\"_blank\" href=\"http://trade.taobao.com/trade/detail/trade_item_detail.htm?bizOrderId={0}\"><span>来自淘宝</span></a>", obj); } } }
private void dItems_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { //if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) //{ // HyperLink hl = (HyperLink)(e.Item.FindControl("hlAddItem")); // //hl.NavigateUrl = hl.NavigateUrl + "&backURL=" + ViewState["backURL"].ToString(); // if (blIsLoggedIn) // hl.Visible = true; // else // hl.Visible = false; //} }
protected void dlListings_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { HyperLink FavoriteLink = (HyperLink)e.Item.FindControl("hlFavorite"); string _mlsNumber = DataBinder.Eval(e.Item.DataItem, "Favorite").ToString(); FavoriteLink.Text = _mlsNumber.ToString(); string vLink = Globals.NavigateURL("View", "pg", "v", "MLS", _mlsNumber.ToString()); vLink = vLink.ToString().Replace("ctl/View/", ""); vLink = vLink.ToString().Replace("Default.aspx", _mlsNumber.ToString() + ".aspx"); FavoriteLink.NavigateUrl = vLink.ToString(); }
private void dlPlaces_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { // Is the item selected? if (e.Item.ItemType == ListItemType.SelectedItem) { // Locate the hidden Label containing the AdministratorID Label admin = (Label)e.Item.FindControl("lblAdministratorID"); // If it matches the current user, show the Edit button if (admin.Text == Page.User.Identity.Name) { e.Item.FindControl("cmdEdit").Visible = true; } } }
/// <summary> /// Handles the items being bound to the datalist control. In this method we merge the data with the /// template defined for this control to produce the result to display to the user /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lstContent_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { // use e.Item.DataItem as object of ObserverOfScienceInfo class, // as we really know it is: var item1 = e.Item.DataItem as ObserverOfScienceInfo; var ctrl = new ObserverOfScienceController(); var item = ctrl.Get <InventionInfo> (item1.InventionId); var HyperName = e.Item.FindControl("HyperName") as HyperLink; var lblContent = e.Item.FindControl("lblContent") as Label; //в таблице нет поля статусvar lblStatus = e.Item.FindControl ("lblStatus") as Label; // var lblScientists = e.Item.FindControl ("lblScientists") as Label; var ImgObserverOfScience = e.Item.FindControl("ImgObserverOfScience") as Image; //var CreateByUser = e.Item.ForeControl ("CreateByUser") as Label; var contentValue = string.Empty; var edit = e.Item.FindControl("HyperLink1") as HyperLink; edit.NavigateUrl = EditUrl("InventionID", item.InventionID.ToString()); if (item.Image != null) { ImgObserverOfScience.ImageUrl = item.Image; } else { ImgObserverOfScience.ImageUrl = "~/DesktopModules/ObserverOfScience/images/irrigation.jpg"; } HyperName.NavigateUrl = EditUrl("ObserverOfScienceID", item.InventionID.ToString(), "DetailView"); linkinvention = HyperName.NavigateUrl; contentValue = Server.HtmlDecode(item.Description); HyperName.Text = contentValue; // contentValue = Server.HtmlDecode (LenghtText(item.Content)); // lblContent.Text = contentValue; contentValue = Server.HtmlDecode(item.Name); //lblStatus.Text =string.Format(Localization.GetString("lblTitle.Format", LocalResourceFile), contentValue); contentValue = null; // foreach(ScientistInfo ind in item.Scientists) // { // contentValue+=ind.User.LastName+" "+ind.User.FirstName+";"; // } // lblScientists.Text=string.Format(Localization.GetString("lblScientists.Format", LocalResourceFile),contentValue); }
private void Datalist2_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem) || (e.Item.ItemType == ListItemType.EditItem)) { string iddiv = ((HtmlGenericControl)e.Item.Controls[15]).ClientID; HtmlAnchor Anchor = (HtmlAnchor)e.Item.Controls[1]; LiteralControl img = (LiteralControl)e.Item.Controls[1].Controls[0]; Anchor.HRef = "javascript:hideControl('" + iddiv + "','" + img.ClientID + "');"; Repeater repeta = (Repeater)e.Item.FindControl("repetarpassi"); repeta.DataSource = BindingPassi(Datalist2.DataKeys[e.Item.ItemIndex].ToString()); repeta.DataBind(); } }
protected void MyList_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item | e.Item.ItemType == ListItemType.AlternatingItem) { Label lbl_type = (Label)e.Item.FindControl("lbl_type"); if (lbl_type.Text == "0") { lbl_type.Text = "Screening Words"; } else { lbl_type.Text = "Restricted UserNames"; } } }