Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
143
WebImageViewer in WebAsyncRefreshPanel
posted

Hi

I'm using the webimageviewer to my web application. I take the Selection example from your Samples Browser, work fine. After that, i put the control into a warp panel, the code to populate with the images is:

 

        protected void LlenaSlideShow()
        {

            WebImageViewer1.Items.Clear();

            ConsultaAnexosFAC caf = new ConsultaAnexosFAC();

            DataSet ds = caf.ListarAnexos("connectionString", ddlCategoria.SelectedValue, txtBuscar.Text, "1");

            caf = null;

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    ImageItem img = new ImageItem(dr["RUT"].ToString() + ".jpg", dr["APELLIDOS"].ToString() + ", " + dr["NOMBRE"].ToString(), dr["APELLIDOS"].ToString() + ", " + dr["NOMBRE"].ToString());
                    img.Key = dr["RUT"].ToString() + ".jpg";
                    WebImageViewer1.Items.Add(img);
                }
            }

            WebImageViewer1.DataBind();

        }

 

i call this method in the Page_Load and still working fine, i call this method from a button control, which is the TriggerControlID to the warp panel. When i click this button, the webimageviewer clear the collection of images, but dont show the new collection.

 

I hope you can help me

 

Regards 

Parents
No Data
Reply
  • 28464
    posted

    I am trying to reproduce something similar with the following setup, but unfortunately to no avail. Here is what I've tried: 

        <igmisc:WebAsyncRefreshPanel ID="WebAsyncRefreshPanel1" runat="server" Height="20px"
            Width="80px" TriggerControlIDs="Button1">
            <cc1:WebImageViewer ID="WebImageViewer1" runat="server" Height="20px" Width="500px">
            </cc1:WebImageViewer>
        </igmisc:WebAsyncRefreshPanel>
       
        <br />
        <br />
        <br />
        <br />
        <asp:Button ID="Button1" runat="server" Text="CallBack"
            onclick="Button1_Click" />

         protected void Button1_Click(object sender, EventArgs e)
        {
            WebImageViewer1.Items.Add(new ImageItem("http://www.google.com", "google", "google"));
            WebImageViewer1.Items.Add(new ImageItem("http://www.google.com", "google", "google"));
        }

    What am I missing? Is there something different in your approach?

Children