I have created simple, empty web project to test my gallery. It's working there with no problems.
This is my DataList:
<asp:Panel ID="panelFilter" runat="server">
<table width="100%">
<tr>
<td>
<dnn:Label ID="lblAlbum" runat="server" Text="Album" Suffix=":" />
</td>
<td>
<asp:DropDownList ID="cboAlbum" runat="server">
</asp:DropDownList>
</td>
</tr>
<tr>
<td colspan="2">
<asp:LinkButton ID="linkShowPhotos" runat="server" OnClick="linkShowPhotos_Click"
Text="Show Photos" />
</td>
</tr>
</table>
</asp:Panel>
<asp:Panel ID="panelImages" runat="server">
<asp:DataList ID="listPhotos" runat="server" OnItemCommand="listPhotos_ItemCommand" RepeatColumns="5"
RepeatDirection="Horizontal" RepeatLayout="Table">
<ItemTemplate>
<asp:ImageButton ID="imgThumbnail" runat="server" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "PhotoThumbnailUrl")%>'
CommandName="click" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "PhotoUrl")%>' />
</ItemTemplate>
</asp:DataList>
</asp:Panel>
<asp:Panel ID="panelImageLarge" runat="server" Visible="false" Height="480" Width="640">
<asp:LinkButton ID="linkClose" runat="server" Text="Close" OnClick="linkClose_Click" />
<hr />
<asp:Image ID="imgLarge" runat="server" AlternateText="" />
</asp:Panel>
and code behind:
#region Events
protected void Page_Load(object sender, System.EventArgs e)
{
// disable cache to avoid image load problem
Response.Cache.SetCacheability(HttpCacheability.NoCache);
try
{
BindData();
}
catch (Exception exc) //Module failed to load
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}
protected void linkShowPhotos_Click(object sender, System.EventArgs e)
{
ShowPhotos(cboAlbum.SelectedItem.Value);
}
protected void listPhotos_ItemCommand(object sender, DataListCommandEventArgs e)
{
if (e.CommandName.ToLower() == "click")
{
this.imgLarge.ImageUrl = e.CommandArgument.ToString();
this.panelFilter.Visible = false;
this.panelImages.Visible = false;
this.panelImageLarge.Visible = true;
}
}
protected void linkClose_Click(object sender, System.EventArgs e)
{
}
#endregion
#region Methods
protected void BindData()
{
// get controller
PicasaGalleryController galleryController = new PicasaGalleryController();
// get list of albums
List<PicasaAlbumInfo> listPicasaAlbums = galleryController.GetAlbumsList();
// bind DropDown of albums
foreach (PicasaAlbumInfo picasaAlbumInfo in listPicasaAlbums)
{
ListItem listItem = new ListItem(picasaAlbumInfo.AlbumTitle, picasaAlbumInfo.AlbumID);
cboAlbum.Items.Add(listItem);
}
}
protected void ShowPhotos(string albumID)
{
// get controller
PicasaGalleryController galleryController = new PicasaGalleryController();
// bind list of photos
listPhotos.DataSource = galleryController.GetPhotosList(albumID);
listPhotos.DataBind();
}
#endregion
--------------------------------------------
All is appearing in one page, on thumbnail click, some panels are changing their visibility. Simple.
I do not have any idea why it is working somewhere else, but not in DNN.