asp:UpdatePanel not work with ImageGallery

3 posts, 0 answers
  1. Zbysek
    Zbysek avatar
    7 posts
    Member since:
    Mar 2012

    Posted 21 Dec 2014 Link to this post

    Telerik version 2014.3.1209.45

    <telerik:RadImageGallery ID="PhotoGallery" runat="server" DataImageField="File" DataDescriptionField="Title" Width="500" >
    </telerik:RadImageGallery>

    // where File is byte[] and Title is string
    ....
    <asp:UpdatePanel runat="server">
       <ContentTemplate>
         <asp:Label ID="Label1" runat="server" Text="Label" />
         <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
       </ContentTemplate>
    </asp:UpdatePanel>
    ....
    protected void Button1_Click(object sender, EventArgs e)
    {
       Label1.Text = "OK"; // not work!!!
    }
  2. Zbysek
    Zbysek avatar
    7 posts
    Member since:
    Mar 2012

    Posted 22 Dec 2014 in reply to Zbysek Link to this post

    Hmmm...

    fail:
    if (!IsPostBack)
    {
      PhotoGallery.DataSource = ...
      PhotoGallery.DataBind();
    }

    right:
    <telerik:RadImageGallery ... OnNeedDataSource="PhotoGallery_NeedDataSource" >
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 25 Dec 2014 Link to this post

    Hello Zbysek,

    Please make sure that you are using either the declarative binding properties of the control or NeedDataSource event handler. You should avoid calling DataBind() and execute any database related logic inside the aforementioned handler.

    Hope this helps.

    Regards,
    Eyup
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top