protected void DataList2_ItemDataBound(object sender, DataListItemEventArgs e)
{
int iRow = e.Item.ItemIndex;
HyperLink lnkItem = (HyperLink)e.Item.FindControl("hlItem");
lnkItem.Style["cursor"] = "hand";
lnkItem.Attributes.Add("onclick", "javascript: ctl00$ContentPlaceHolder1$txtItemID.value='" + DataList2.DataKeys[iRow].ToString() + "'; this.style.fontweight='bold'; return false;");
}
为什么 this.style.fontweight='bold'; 这句不起作用?其它都是正常的。
{
int iRow = e.Item.ItemIndex;
HyperLink lnkItem = (HyperLink)e.Item.FindControl("hlItem");
lnkItem.Style["cursor"] = "hand";
lnkItem.Attributes.Add("onclick", "javascript: ctl00$ContentPlaceHolder1$txtItemID.value='" + DataList2.DataKeys[iRow].ToString() + "'; this.style.fontweight='bold'; return false;");
}
为什么 this.style.fontweight='bold'; 这句不起作用?其它都是正常的。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货