本文整理汇总了C#中System.Web.UI.WebControls.DataListItemEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# DataListItemEventArgs类的具体用法?C# DataListItemEventArgs怎么用?C# DataListItemEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataListItemEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了DataListItemEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: dlAlsoPurchasedProducts_ItemDataBound
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;
}
}
}
}
示例2: ImagesList_ItemDataBound
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();
}
示例3: lstItem_ItemDataBound
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 + "')";
}
}
示例4: pointList_ItemDataBound
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 = "退款扣积分";
}
}
}
}
示例5: dlArticle_ItemDataBound
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();
}
}
}
示例6: DataList1_ItemDataBound
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();
}
}
示例7: rptPaging_ItemDataBound
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");
}
示例8: dlEmployee_ItemDataBound
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();
}
示例9: lstPurchases_ItemDataBound
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");
}
}
示例10: dlDoctors_ItemDataBound
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"]);
}
}
}
示例11: DlManufacturers_OnItemDataBound
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);
}
}
}
示例12: dlstOrderItems_ItemDataBound
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);
}
}
}
示例13: dlFlight_ItemDataBound
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;
}
}
}
示例14: DataListSzukaj_ItemDataBound
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();
}
示例15: lstItem_ItemDataBound
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);
}
}