protected void rptLastPromotion_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
{
HtmlAnchor aView = (HtmlAnchor)e.Item.FindControl("aDescription");
Label lbldescriptionlink = (Label)e.Item.FindControl("lblDescription");
Label lbldescriptionNoLink = (Label)e.Item.FindControl("lblDescription2");
HiddenField hfIsNewTab = (HiddenField)e.Item.FindControl("hfNewTab");
for (int i = 0; i <= rptLastPromotion.Items.Count; i++)
{
if (!String.IsNullOrEmpty(aView.HRef))
{
lbldescriptionlink.Visible = true;
lbldescriptionNoLink.Visible = false;
if (Convert.ToBoolean(hfIsNewTab.Value) == true)
{
aView.Target = "_blank";
}
}
else
{
lbldescriptionlink.Visible = false;
lbldescriptionNoLink.Visible = true;
}
}
}
我想处理和查看转发器中的项目,但我的代码中有错误。这有什么帮助吗?