Hi all,
I have a ITemplate, and I set it to LayoutTemplate in my control AjaxFileUpload that inherits from EO.Web.AJAXUploader.
But when pages render not is right.
Any help please ?
Thanks
My control AjaxFileUpload
public class AjaxFileUpload : EO.Web.AJAXUploader
...
Code: C#
protected override void CreateChildControls()
{
AjaxFileUpload_LayoutTemplate template = new AjaxFileUpload_LayoutTemplate();
this.LayoutTemplate = template;
base.CreateChildControls();
}
My ITemplate
Code: C#
public class AjaxFileUpload_LayoutTemplate : ITemplate
{
public void InstantiateIn(System.Web.UI.Control container)
{
var inputPlaceHolder = new HtmlGenericControl("PlaceHolder") { ID = "InputPlaceHolder" };
var progressBar = new ProgressBar();
progressBar.ID = "ProgressBar";
progressBar.ControlSkinID = "Windows_XP";
var hr = new HtmlGenericControl("hr");
var cancelButton = new ImageButton();
cancelButton.ID ="CancelButton";
cancelButton.ImageUrl="~/Images/Detener.png";
cancelButton.MarginLeft= new Unit(10, UnitType.Pixel);
cancelButton.MarginTop= new Unit(5, UnitType.Pixel);
cancelButton.ToolTip="Cancelar";
var deleteButton = new ImageButton();
deleteButton.ID ="DeleteButton";
deleteButton.ImageUrl="~/Images/Anular.png";
deleteButton.MarginLeft= new Unit(10, UnitType.Pixel);
deleteButton.MarginTop= new Unit(5, UnitType.Pixel);
deleteButton.ToolTip="Borrar ficheros seleccionados";
deleteButton.FirstColumn = false;
deleteButton.LastColumn = true;
var hr2 = new HtmlGenericControl("hr");
var postedFilesPlaceHolder = new HtmlGenericControl("PlaceHolder") { ID = "PostedFilesPlaceHolder" };
container.Controls.Add(inputPlaceHolder);
container.Controls.Add(progressBar);
container.Controls.Add(hr);
container.Controls.Add(hr2);
container.Controls.Add(cancelButton);
container.Controls.Add(hr2);
container.Controls.Add(deleteButton);
container.Controls.Add(hr2);
container.Controls.Add(hr2);
container.Controls.Add(postedFilesPlaceHolder);
// <LayoutTemplate>
// <asp:PlaceHolder ID="InputPlaceHolder" runat="server" />
// <eo:ProgressBar ID="ProgressBar" runat="server" ControlSkinID="Windows_XP" />
// <asp:PlaceHolder ID="ProgressTextPlaceHolder" runat="server" />
// <%//<RealeUI:Button ID="CancelButton" runat="server" Text="Cancelar" LastColumn="true" />
// //<RealeUI:Button ID="DeleteButton" runat="server" Text="Borrar ficheros seleccionados" /> %>
// <hr />
// <RealeUI:ImageButton ID="CancelButton" runat="server" ImageUrl="~/Images/Detener.png" MarginLeft="10px" MarginTop="5px" ToolTip="Cancelar" />
// <RealeUI:ImageButton ID="DeleteButton" runat="server" ImageUrl="~/Images/Anular.png" FirstColumn="false" MarginLeft="10px" MarginTop="5px" ToolTip="Borrar ficheros seleccionados" LastColumn="true" />
// <hr />
// <asp:PlaceHolder ID="PostedFilesPlaceHolder" runat="server" />
//</LayoutTemplate>
}
}