for (int i = 0; i < Files.Count; i++) { HtmlImage image=new HtmlImage(); image.ID="ImageAN"+i.ToString(); image.Src=Files[i].ToString(); image.Alt="PrintImage"; image.Attributes.Add("class","PrintImage"); div_Print.Controls.Add(image); }
this.ClientScript.RegisterStartupScript(this.GetType(), "ClientScript", " PrintContent('div_Print')", true);
<script type="text/javascript"> function PrintContent(divName) { var DocumentContainer = document.getElementById(divName); var WindowObject = window.open(); WindowObject.document.writeln(DocumentContainer.innerHTML); WindowObject.document.close(); WindowObject.focus(); WindowObject.print(); WindowObject.close(); } </script>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)