<div id="fileList" runat="server"></div> <script type="text/javascript"> function debugScroll() { var obj = document.getElementById("fileList"); alert(obj.innerHTML); } </script> protected string directoryPath = "../Images/"; public System.Web.UI.HtmlControls.HtmlGenericControl fileList; fileList.InnerHtml = "";