This is a migrated thread and some comments may be shown as answers.

asp:UpdatePanel not work with ImageGallery

2 Answers 47 Views
ImageGallery
This is a migrated thread and some comments may be shown as answers.
Zbysek
Top achievements
Rank 1
Zbysek asked on 21 Dec 2014, 04:40 PM
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 Answers, 1 is accepted

Sort by
0
Zbysek
Top achievements
Rank 1
answered on 22 Dec 2014, 09:31 AM
Hmmm...

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

right:
<telerik:RadImageGallery ... OnNeedDataSource="PhotoGallery_NeedDataSource" >
0
Eyup
Telerik team
answered on 25 Dec 2014, 08:13 AM
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.

 
Tags
ImageGallery
Asked by
Zbysek
Top achievements
Rank 1
Answers by
Zbysek
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or