110,500
社区成员
发帖
与我相关
我的任务
分享
protected void rePhotoComments_ItemCommand(object source, RepeaterCommandEventArgs e)
{
Panel plFace = (e.Item.FindControl("plFace") as Panel);
if (e.CommandName == "showFace")
{
BindFace(plFace);
}
if (e.CommandName == "abc")
{
string str = "";
}
}
public void BindFace(Panel panel)
{
string[] strFaces ={ "坏笑", "汗", "奋斗", "馋", "哭", "傻笑", "帅", "大笑", "奸笑", "鼻涕", "睡觉", "绷带", "酷", "色", "怒" };
for (int i = 0; i < strFaces.Length; i++)
{
ib = new ImageButton();
ib.ImageUrl = "/PhotoManage/img/face/" + strFaces[i] + ".gif";
ib.ID = strFaces[i];
//ib.Command += new CommandEventHandler(ib_Command);
ib.Click += new ImageClickEventHandler(ib_Click);
ib.CommandName = "abc";
panel.Controls.Add(ib);
}
}
protected void ib_Command(object sender, CommandEventArgs e)
{
Response.Write("fda" + e.CommandName);
}
protected void ib_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
ImageButton ib = (ImageButton)sender;
TextBox1.Text = "";
TextBox1.Text += ib.ID;
}