我的问题是我需要从 ImageGallery 项中获取文本并将其添加为 aspxgridview 中的一行,但我无法这样做,因为我无法在 javascript 或 c# 中加载该文本。我所知道的只是e.index,它代表点击的图像数量。这是我代码的一部分:
<Items>
<dx:ImageGalleryItem Text="blablabla" ImageUrl="~/Models/24.jpg">
</dx:ImageGalleryItem>
</Items>
<SettingsTableLayout RowsPerPage="1" />
<ClientSideEvents FullscreenViewerShowing="OnFullscreenViewerShowing" />
</dx:ASPxImageGallery>
var imageIndex = 0;
function OnFullscreenViewerShowing(s, e) {
imageIndex = e.index;
if (e.index == 0) {
alert(e.index.text);
} else if (e.index == 1) {
}
popup.Show();
}
确保在ASPxImageGallery
控件上设置了ClientInstanceName
。设置 ClientInstanceName 将为控件启用客户端事件。