Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Dynamically displaying a bunch images using Ajax

$
0
0

Hi,

I have a bunch of images stored in a List<string> storing the paths of the images which I have obtained using AjaxFileUpload.

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </asp:ToolkitScriptManager><asp:ajaxfileupload ID="Ajaxfileupload1" runat="server" OnUploadComplete="FileUploadComplete" OnUploadCompleteAll="FileUploadCompleteAll" EnableViewState="true" ></asp:ajaxfileupload><asp:UpdatePanel ID="_updatePanel" runat="server"><ContentTemplate><asp:PlaceHolder ID="_ph" runat="server"></asp:PlaceHolder></ContentTemplate></asp:UpdatePanel>

In codebehind, I have

protected void FileUploadCompleteAll(object sender, System.EventArgs e)
{
  for (int i = 0; i < fN.Count; i++)
  {
     System.Web.UI.WebControls.Image img = new System.Web.UI.WebControls.Image();
     img.ImageUrl = fN[i];
     _ph.Controls.Add(img);

  }        
}

fN is a List<string> and has all the image paths.

Please let me know what wrong I am doing here and a possible fix.

Thank you


Viewing all articles
Browse latest Browse all 5678

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>