I put ajaxuploader inside <UpdateItemTemplate> of ListView. Except uploader there's a TextBox1 and I want to update its Text property with the address of uploaded image. So I've got the problem with assigning data to TextBox1.Text.
I tried to assign image_address.Text property through Label4.Text which is outside of listview, but it doesn't work.
How to find TextBox1 control? Or how to update property correctly?
- public void Uploader_FileUploaded(object sender, UploaderEventArgs args)
- {
- args.CopyTo(@"D:\images\menu\" + args.FileName);
- ResizeImage(@"D:\images\menu\" + args.FileName, @"D:\images\menu\small_" + args.FileName, 150, 100, false);
- args.Delete();
- Label4.Visible = true;
- Label4.Text = @"D:\imagesmenu\small_" + args.FileName;
-
- TextBox huyimg = (TextBox)(ListView1.Items[ListView1.SelectedIndex].FindControl("TextBox1"));
- huyimg.Text = @"D:\imagesmenu\small_" + args.FileName;
- }
-
- protected void ListView1_ItemUpdating(object sender, ListViewUpdateEventArgs e)
- {
- ListViewItem myItem = ListView1.Items[ListView1.EditIndex];
- TextBox image_address = (TextBox)(ListView1.Items[e.ItemIndex].FindControl("TextBox1"));
- image_address.Text = Label4.Text;
-
- ...
-
- ListView1.EditIndex = -1;
- BindList();
- }