0
我有一個使用ItemDataBound的方法;ItemDataBound上的方法用法C#ASP.net
static void getPhoto() {
Fonksiyonlar vt=new Fonksiyonlar();
DataTable SeriFoto = vt.GetDataTable("select foto from seriFotograf where seriilanID=" + DataBinder.Eval(e.Item.DataItem, "ilan_id") + " and kapak=true" + " order by seriilanID desc");
if (SeriFoto.Rows.Count < 1)
{
DataRow nullPhotoRow;
nullPhotoRow = SeriFoto.NewRow();
nullPhotoRow["foto"] = "0.png";
SeriFoto.Rows.Add(nullPhotoRow);
}
Repeater rptReddedilenFoto = (Repeater)e.Item.FindControl("rptReddedilenFoto");
rptReddedilenFoto.DataSource = SeriFoto;
rptReddedilenFoto.DataBind();
}
,但我得到一個錯誤:
The name 'e' does not exist in the current context
正常運行這些代碼,但它的方法沒有。
是_e_傳遞給調用此方法的事件處理程序的說法? – Steve
你使用什麼網頁控制?一個'DataGrid'? –