Add custom description programmatically to galeria

warezz1234

New Member
i have Gallery with Galleria and it works correctly i add images to galleria programmatically :\[code\] <div id="galleria" class="content" style="height: 500px;"> <asp:placeholder id="placeholder1" runat="server"></asp:placeholder> </div> <script type="text/javascript"> // Load the classic theme Galleria.loadTheme('Resource/Script/galleria.classic.min.js'); // Initialize Galleria Galleria.run('#galleria'); </script>\[/code\]and here is my code:\[code\]protected void Page_Load(object sender, EventArgs e) { int GalleryTypeId = int.Parse(Request.QueryString["GalleryTypeId"].ToString()); List<DAL.Gallery> Gallerys = (from rs in General.Db.Galleries where rs.GalleryTypeId == GalleryTypeId select rs).ToList(); foreach (DAL.Gallery item in Gallerys) { HyperLink newLink = new HyperLink(); newLink.ImageUrl = "/Resource/Gallery/640x480/" + item.ImageFileName; Image newImage = new Image(); newImage.ImageUrl = "Resource/Gallery/86x58/" + item.ImageFileName; // *** newImage.Attributes["data-title"] = item.Title; newImage.Attributes["data-description"] = item.Descripton; //*** newLink.Controls.Add(newImage); placeholder1.Controls.Add(newLink); } }\[/code\]my Galleria Works Correcty (show images in slide)now i want have description and title on every pic and galleria support this. in galleria.io website document said you must initialize "data-title" and "data-description" attribbuts. so i do it (see star block in my code) but my galleria works correctly(and browser didn't have java error) but don't display descriptioni read these linkadd custom attribute programmaticallythank for your help.
 
Back
Top