User control ASCX:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ShowImageControl.ascx.cs" Inherits="CMSApp.ShowImage.Control.ShowImage" %>
<asp:Panel runat="server" ID="AddToDivImages">
</asp:Panel>
CodeBehind:
using System;
namespace CMSApp.ShowImage.Control
{
public partial class ShowImage : System.Web.UI.UserControl
{
public string ImageFieldValues { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
string[] values = ImageFieldValues.Split('|');
//TODO: here is your foreach loop, with which u will add dynamically images to the asp:panel
}
}
}
ASCX transformation:
<%@ Register Src="~/ShowImage/Control/ShowImageControl.ascx" TagPrefix="si" TagName="ShowImage" %>
<si:ShowImage runat="server" id="ShowImageID" ImageFieldValues=<%# Eval("FieldName") %> />