protected void btApply_Click(object sender, EventArgs e) { for (int i = 0; i < rptPhotoList.Items.Count; i++) { CheckBox cbx = (CheckBox)rptPhotoList.Items[i].FindControl("cbxAction"); if (cbx.Checked) { Label lbl = (Label)rptPhotoList.Items[i].FindControl("lblFileID"); MediaFile _MediaFile = new MediaFile() { FileID = Convert.ToInt32(lbl.Text) }; _MediaFile = _MediaFile.Get(); lblFileID.Text = _MediaFile.FileID.ToString(); imgMediaUpload.ImageUrl = Constant.MEDIA_URL + _MediaFile.Path; txtPath.Text = Constant.MEDIA_URL + _MediaFile.Path; txtDescription.Text = _MediaFile.Description; txtTags.Text = _MediaFile.Tags; Response.Redirect(Constant.ADMIN_PATH + Resources.Url.Gallery); } } Message.Alert(Page, "Bạn chưa chọn ảnh!"); }