日期:2014-05-18 浏览次数:20372 次
/// <summary> /// 控件绑定事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void gdvStore_DataBound(object sender, EventArgs e) { for (int i = 0; i < this.gdvStore.Rows.Count; i++) { string strType = this.gdvStore.DataKeys[i]["storeType"].ToString().Trim(); DropDownList dl2 = new DropDownList(); dl2 = (DropDownList)gdvStore.Rows[i].Cells[7].FindControl("ddlStoreType"); if (strType == "-1")//判断店铺推荐排行:-1:不推荐 dl2.SelectedIndex = 0; if (strType == "0") //0:首页推荐 dl2.SelectedIndex = 1; if (strType == "1") //1:小说推荐 dl2.SelectedIndex = 2; } }
------解决方案--------------------
<%# Eval("")=="Yes"?"a.gif":"b.gif"%>
------解决方案--------------------
<img src='<%# Eval("字段").ToString()=="Yes"?"yes.gif":"no.gif"%>' />