ajaxuploader inside listview

  •  04-26-2010, 2:18 AM

    ajaxuploader inside listview

    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?
    1. public void Uploader_FileUploaded(object sender, UploaderEventArgs args)  
    2. {  
    3.         args.CopyTo(@"D:\images\menu\" + args.FileName);  
    4.         ResizeImage(@"D:\images\menu\" + args.FileName, @"D:\images\menu\small_" + args.FileName, 150, 100, false);  
    5.         args.Delete();  
    6.         Label4.Visible = true;  
    7.         Label4.Text = @"D:\imagesmenu\small_" + args.FileName;  
    8.         //(TextBox) huyimg = (TextBox)(ListView1.Controls[0].FindControl("TextBox1"));  
    9.         TextBox huyimg = (TextBox)(ListView1.Items[ListView1.SelectedIndex].FindControl("TextBox1"));  
    10.         huyimg.Text = @"D:\imagesmenu\small_" + args.FileName;  
    11. }  
    12.   
    13. protected void ListView1_ItemUpdating(object sender, ListViewUpdateEventArgs e)  
    14.     {   
    15.         ListViewItem myItem = ListView1.Items[ListView1.EditIndex]; 

    16.         TextBox image_address = (TextBox)(ListView1.Items[e.ItemIndex].FindControl("TextBox1"));  
    17.         image_address.Text = Label4.Text;  
    18.   
    19.         ...
    20.   
    21.         ListView1.EditIndex = -1;  
    22.         BindList();  
    23.     }
View Complete Thread