本文整理汇总了C#中RepeaterItemEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# RepeaterItemEventArgs类的具体用法?C# RepeaterItemEventArgs怎么用?C# RepeaterItemEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RepeaterItemEventArgs类属于命名空间,在下文中一共展示了RepeaterItemEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RptPageType_DataBound
protected void RptPageType_DataBound(object source, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Repeater RptPageList = (Repeater)e.Item.FindControl("RptPageList");
DataRowView rowv = (DataRowView)e.Item.DataItem;//找到分类Repeater关联的数据项
string _strManagerID = LCmn.Func.GetManageID();
if (string.IsNullOrEmpty(_strManagerID)) return;
string _strRoleID = Cmn.DB.getFieldValue("select roleID from adm_manager where managerID='" + _strManagerID + "';");
if (_strRoleID.Equals("1"))
{
_strSql = "select ManagePageDesc,ManagePageUrl,ManagePageType from adm_managePage where ManagePageType=" + rowv[0] + " order by SortID desc";
}
else
{
_strSql = @"select ManagePageDesc,ManagePageUrl,ManagePageType from adm_managePage mp
inner join adm_authority a on mp.ManagePageID=a.ManagePageID
where roleId='" + _strRoleID + " and ManagePageType=" + rowv[0] + " ' " + @"
order by SortID desc";
}
RptPageList.DataSource = Cmn.DB.getDataTable(_strSql);
RptPageList.DataBind();
}
}
示例2: m_repMapRepeater_ItemDataBound
void m_repMapRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
TadImage oImageInfo = e.Item.DataItem as TadImage;
LinkButton oLink = e.Item.FindControl("m_lbName") as LinkButton;
oLink.Text = oImageInfo.Title;
oLink.PostBackUrl = "ViewMap.aspx?ImageId=" + oImageInfo.Id;
Label oLabel = e.Item.FindControl("m_lblDescription") as Label;
oLabel.Text = oImageInfo.Description;
Image oImage = e.Item.FindControl("m_imgImage") as Image;
oImage.Width = 80;
oImage.Height = 80;
PostBackOptions options = new PostBackOptions(oLink, "", "ViewMap.aspx?ImageId=" + oImageInfo.Id, true, false, false, true, false, "");
HtmlControl oDiv = e.Item.FindControl("ListItem") as HtmlControl;
oDiv.Attributes.Add("onClick", ClientScript.GetPostBackEventReference(options));
oDiv.Attributes.Add("onMouseOver", "this.style.background = '#FFFFCC';");
oDiv.Attributes.Add("onMouseOut", "this.style.background = '#FFFFFF';");
ThreeSharpWrapper s3 = new ThreeSharpWrapper(S3Storage.AccessKey, S3Storage.SecretAccessKey);
oImage.ImageUrl = s3.GetUrl(S3Storage.BucketName, "Square_" + oImageInfo.StorageKey);
//oImage.ImageUrl = "http://" + S3Storage.BucketName + ".s3.amazonaws.com/Square_" + oImageInfo.StorageKey;
}
示例3: rptTeams_ItemDataBound
protected void rptTeams_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
DropDownList drpStanding = (DropDownList)e.Item.FindControl("drpStanding");
int year = cf.getMaxYear();
SortedList teams = new SortedList();
int cnt = 0;
if (Session["user"] != null)
{
user u = (user)Session["user"];
teams = u.get_teams();
rptTeams.DataSource = null;
}
if (teams == null)
{
teams = cf.getTeams(year);
}
cnt = teams.Count;
for (int i = 0; i < cnt; i++)
{
int s = i + 1;
drpStanding.Items.Add(new ListItem(s.ToString(), s.ToString()));
}
try
{
drpStanding.SelectedIndex = e.Item.ItemIndex;
}
catch (Exception ex)
{
cf.logError(ex);
}
}
示例4: rptrNewsInHome_ItemDataBound
protected void rptrNewsInHome_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
{
Label lblIDNews = e.Item.FindControl("lblIDNews") as Label;
HyperLink lnkTitle = e.Item.FindControl("lnkTitle") as HyperLink;
HyperLink lnkImage = e.Item.FindControl("lnkImage") as HyperLink;
Image imgMinhhoa = e.Item.FindControl("imgMinhhoa") as Image;
Label lblDesc = e.Item.FindControl("lblDesc") as Label;
HyperLink lnkChitiet = e.Item.FindControl("lnkChitiet") as HyperLink;
if (lnkTitle != null && imgMinhhoa != null && lnkChitiet != null && lnkImage != null && lblDesc != null)
{
NewsEntity newsEntity = new NewsEntity();
newsEntity = NewsBRL.GetOne(Convert.ToInt32(lblIDNews.Text));
lnkTitle.NavigateUrl = "~/Content.aspx?sID=" + newsEntity.iNewsID;
lnkChitiet.NavigateUrl = "~/Content.aspx?sID=" + newsEntity.iNewsID;
lnkTitle.Text = INVI.INVILibrary.INVIString.GetCuttedString(newsEntity.sTitle, 70);
if (File.Exists(Server.MapPath(ConfigurationManager.AppSettings["UploadPath"] + newsEntity.sImage)))
imgMinhhoa.ImageUrl = ConfigurationManager.AppSettings["UploadPath"] + newsEntity.sImage;
else
{
Panel pnAnh = e.Item.FindControl("pnAnh") as Panel;
pnAnh.Visible = false;
}
lblDesc.Text = INVI.INVILibrary.INVIString.GetCuttedString(newsEntity.sDesc, 150);
}
}
}
}
示例5: BindQuestionText
protected void BindQuestionText(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
bool isSubQuestion = Convert.ToBoolean(((Label)e.Item.FindControl("lblIsSubQuestion")).Text);
Label questionLabel = (Label)e.Item.FindControl("lblQuestionText");
string unformattedQuestionText = questionLabel.Text;
string formattedQuestionText = null;
if (isSubQuestion)
{
formattedQuestionText = unformattedQuestionText;
}
else
{
formattedQuestionText = "<b>" + (questionNumber + 1).ToString() + ". " + unformattedQuestionText + "</b>";
questionNumber++;
}
questionLabel.Text = formattedQuestionText;
}
}
示例6: repDeptList_ItemDataBound
protected void repDeptList_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
random++;
Model.T_Department dept = (Model.T_Department)e.Item.DataItem;
Literal liDeptID = e.Item.FindControl("liDeptID") as Literal;
liDeptID.Text = dept.Id.ToString();
Literal liDeptName = e.Item.FindControl("liDeptName") as Literal;
liDeptName.Text = dept.DeptName;
RadioButtonList rblist = e.Item.FindControl("rblist") as RadioButtonList;
List<int> vdList = new List<int>();
//生成随机列
for (int i = 0; i <= 3; i++)
{
Random rad = new Random(random);
int v1 = rad.Next(0, 4);
while (vdList.Where(v => v == v1).Count() > 0)
{
v1 = rad.Next(0, 4);
};
vdList.Add(v1);
ListItem li = liList[v1];
li.Attributes.Add("onclick", "clickRB(this)");
rblist.Items.Add(liList[v1]);
}
}
示例7: Repeater1_ItemDataBound
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
int id = int.Parse(((Label)e.Item.FindControl("lb_ID")).Text);
QNA_QuestionBLL q = new QNA_QuestionBLL(id);
RadioButtonList rbl_Result = (RadioButtonList)e.Item.FindControl("rbl_Result");
CheckBoxList cbl_Result = (CheckBoxList)e.Item.FindControl("cbl_Result");
TextBox tbx_Result = (TextBox)e.Item.FindControl("tbx_Result");
if (q.Model != null)
{
switch (q.Model.OptionMode)
{
case 1: //单选
rbl_Result.DataSource = q.Items;
rbl_Result.DataBind();
rbl_Result.Visible = true;
break;
case 2: //多选
cbl_Result.DataSource = q.Items;
cbl_Result.DataBind();
cbl_Result.Visible = true;
break;
case 3: //输入文本
tbx_Result.Visible = true;
break;
}
}
}
}
示例8: RptExport_ItemDataBound
protected void RptExport_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if ((e.Item.ItemType != ListItemType.Header) && (e.Item.ItemType != ListItemType.Footer))
{
Label lblName = (Label)e.Item.FindControl("lblName");
Label lblPrice = (Label)e.Item.FindControl("lblPrice");
//Label lblQuantity = (Label)e.Item.FindControl("lblQuantity");
//Label lblProductTotal = (Label)e.Item.FindControl("lblProductTotal");
int nQuantity = 1;
int nProductID = ConvertData.ConvertToInt(DataBinder.Eval(e.Item.DataItem, "ProductID2"));
Products objProduct = new Products();
objProduct.LoadById(nProductID);
string sNameProduct = ConvertData.ConvertToString(objProduct.Data.ProductName);
int nPrice = ConvertData.ConvertToInt(objProduct.Data.Price);
lblName.Text = sNameProduct;
lblPrice.Text = ConvertData.ConvertToString(Support.FormatCurrency(nPrice)) + " " + "vn₫";
//lblQuantity.Text = ConvertData.ConvertToString(nQuantity);
int nTotal = nPrice * nQuantity;
//lblProductTotal.Text = ConvertData.ConvertToString(Support.FormatCurrency(nTotal)) + " " + "vn₫";
int nTotalOrder = nTotal;
fSubTotal += ConvertData.ConvertToDouble(nTotal);
}
lblTotal.Text = ConvertData.ConvertToString(Support.FormatCurrency(fSubTotal)) + " " + "vn₫";
}
示例9: SetAuthor
protected void SetAuthor(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
string strAuthorText;
DataRowView TempRow = (DataRowView)e.Item.DataItem;
if (TempRow["PortfolioID"].ToString().Length > 0)
strAuthorText = TempRow["FirstName"].ToString();
else
{
strAuthorText = TempRow["PartnerNickname"].ToString();
// Make whistle image visible
if (((CareerCruisingWeb.PageBase.SuperBase)Page).ConSysInfo["CareerCoaches"].ToString() == "True")
{
((System.Web.UI.WebControls.Image)e.Item.FindControl("CoachImage")).Visible = true;
}
else { ((System.Web.UI.WebControls.Image)e.Item.FindControl("CoachImage")).Visible = false; }
}
((Label)e.Item.FindControl("AuthorLabel")).Text = strAuthorText;
// Also set Deactivate link visibility
if (_ShowDeactivateLink)
((System.Web.UI.HtmlControls.HtmlTableCell)e.Item.FindControl("DeactivateCell")).Visible = true;
else
((System.Web.UI.HtmlControls.HtmlTableCell)e.Item.FindControl("DeactivateCell")).Visible = false;
}
}
示例10: CartsContainer_ItemDataBound
protected void CartsContainer_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
HiddenField hiddenField = e.Item.FindControl("hiddenReceiptId") as HiddenField;
Helper.ExecScript(@"
jsHiddenReceiptId[" + e.Item.ItemIndex + "] = '" + string.Format("#{0}", hiddenField.ClientID) + @"';
");
}
示例11: rptNewsList_ItemDataBound
protected void rptNewsList_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if ((e.Item.ItemType != ListItemType.Header) && (e.Item.ItemType != ListItemType.Footer))
{
HyperLink lnkimgList = (HyperLink)e.Item.FindControl("lnkimgList");
Image imgNewsList = (Image)e.Item.FindControl("imgNewsList");
HyperLink lnkNewName = (HyperLink)e.Item.FindControl("lnkNewName");
Label lblInitContent = (Label)e.Item.FindControl("lblInitContent");
int nID = ConvertData.ConvertToInt(DataBinder.Eval(e.Item.DataItem, "NewsID"));
string sTitle = ConvertData.ConvertToString(DataBinder.Eval(e.Item.DataItem, "Title"));
string sURL = Constants.ROOT + Pages.FrontEnds.NEWS + "?" + Constants.NEWS_ID + "=" + nID;
string sInitContent = ConvertData.ConvertToString(DataBinder.Eval(e.Item.DataItem, "InitContent"));
string strImages = ConvertData.ConvertToString(DataBinder.Eval(e.Item.DataItem, "Image"));
lnkNewName.Text = sTitle;
lnkNewName.NavigateUrl = sURL;
lnkNewName.ToolTip = sTitle;
lnkimgList.NavigateUrl = sURL;
lblInitContent.Text = sInitContent;
imgNewsList.ToolTip = sTitle;
if (strImages.Length > 0)
{
imgNewsList.ImageUrl = Constants.ROOT + Constants.IMAGE_NEWS_DEFAULT_UPLOAD + strImages;
}
else
{
imgNewsList.ImageUrl = Constants.ROOT + Constants.IMAGE_NO_IMAGE_FRONTEND_280;
}
}
}
示例12: CustomTableRep_ItemDataBound
protected void CustomTableRep_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
DataTable dt = new DataTable();
dt = BCustomFormField.GetTitleList(CustomFormId);
if (e.Item.ItemType == ListItemType.Header)
{
//列举出所有的字段当头部
StringBuilder sb = new StringBuilder();
for (int i = 0; i < dt.Rows.Count; i++)
{
sb.Append("<td>"+dt.Rows[i]["Alias"].ToString()+"</td>");
}
(e.Item.FindControl("lit_head") as Literal).Text = sb.ToString();
}
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType==ListItemType.AlternatingItem)
{
//行ID
int Id = int.Parse((e.Item.FindControl("CustomFormFieldId") as Label).Text);
drInfo = BInfoOper.GetInfo(MCustomForm.TableName, Id);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < dt.Rows.Count; i++)
{
sb.Append("<td>" + Function.Encode(drInfo["" + dt.Rows[i]["Name"].ToString() + ""].ToString()) + "</td>");
}
(e.Item.FindControl("lit_item") as Literal).Text = sb.ToString();
}
}
示例13: Appointments_ItemDataBound
protected void Appointments_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
currentAppointment = (Appointment)e.Item.DataItem;
if (currentAppointment == null)
return;
ImageButton btnDel = (ImageButton)e.Item.FindControl("ButtonDelete");
btnDel.CommandArgument = currentAppointment.Id.ToString();
btnDel.Attributes["OwnerId"] = LoginState.IsAdmin() ? "admin" : currentAppointment.UserId;
Repeater inner = (Repeater)e.Item.FindControl("Posts");
List<Post> posts = new List<Post>();
foreach (Post p in currentAppointment.AppointmentPosts)
posts.Add(p);
posts.Sort((a, b) => a.PostingDate.CompareTo(b.PostingDate));
inner.DataSource = posts;
inner.ItemDataBound += new RepeaterItemEventHandler(inner_ItemDataBound);
inner.DataBind();
TextBox txt = (TextBox)e.Item.FindControl("Name");
Button btn = (Button)e.Item.FindControl("ButtonSend");
btn.CommandArgument = currentAppointment.Id.ToString();
btn.OnClientClick = string.Format("onSendPost('{0}');", txt.ClientID);
HtmlImage img = (HtmlImage)e.Item.FindControl("Meteo");
int idx = currentAppointment.AppointmentDate.DayOfYear - DateTime.Now.DayOfYear;
if (idx < 0 || idx > 6)
img.Visible = false;
else
img.Src = string.Format("http://www.ilmeteo.it/cartine2/{0}.LIG.png", idx);
}
示例14: RepeaterItemDataBound
/// <summary>
/// 为RepeaterItem绑定数据
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void RepeaterItemDataBound(object sender, RepeaterItemEventArgs e)
{
//用户控件的使用
UserControl_TaListItem1 assignmentItem1 = (UserControl_TaListItem1)e.Item.FindControl("TaListItem10");
//用户控件
UserControl_TaListItem2 assignmentItem2 = (UserControl_TaListItem2)e.Item.FindControl("TaListItem20");
//new一个AssignmentInfo对象
AssignmentInfo a = new AssignmentInfo();
//初始化
a.DtAssignDate = Convert.ToDateTime(DataBinder.Eval(e.Item.DataItem, "assignDate"));
a.DtDeadline = Convert.ToDateTime(DataBinder.Eval(e.Item.DataItem, "deadline"));
a.IAssignmentId = Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "ID"));
a.StrContents = Convert.ToString(DataBinder.Eval(e.Item.DataItem, "contents"));
a.StrTitle = Convert.ToString(DataBinder.Eval(e.Item.DataItem, "title"));
//判断作业是否为空
if (assignmentItem1!=null)
{
assignmentItem1.A = a;
assignmentItem1.Index = index++;
}
else
{
assignmentItem2.A = a;
assignmentItem2.Index = index++;
}
}
示例15: rptTgRecord_ItemDataBound
protected void rptTgRecord_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
{
DJ_GroupConsumRecord record = e.Item.DataItem as DJ_GroupConsumRecord;
Literal laIsChecked = e.Item.FindControl("laIsChecked") as Literal;
if (record.Id.Equals(Guid.Empty))
{
laIsChecked.Text = "未验证";
}
else
laIsChecked.Text = "已验证";
}
if (e.Item.ItemType == ListItemType.Footer)
{
Literal laGuiderCount = e.Item.FindControl("laGuiderCount") as Literal;
Literal laAdultCount = e.Item.FindControl("laAdultCount") as Literal;
Literal laChildrenCount = e.Item.FindControl("laChildrenCount") as Literal;
int groupcount, adultcount, childrencount;
bllrecord.GetCountInfoByETid(Master.Scenic.Id, out groupcount, out adultcount, out childrencount, ListRecord);
laGuiderCount.Text = groupcount.ToString();
laAdultCount.Text = adultcount.ToString();
laChildrenCount.Text = childrencount.ToString();
}
}