ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Zip folder containing Excel files and then download in ASP.Net<p>Hi all</p> <p>Can any one give me an idea about how to zip the folder and ask for the open save prompt in c#.net</p> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/202919/Zip-folder-containing-Excel-files-and-then-download-in-ASPNet/https://www.aspforums.net:443/Threads/202919/Zip-folder-containing-Excel-files-and-then-download-in-ASPNet/Thu, 17 Jan 2013 22:33:21 GMTWord Document Using Asp.net<p>im getting the error,</p> <p>Error3Could not resolve COM reference "0002e558-0000-0000-c000-000000000046" version 1.1. Object reference not set to an instance of an object</p>https://www.aspforums.net:443/Threads/526478/Word-Document-Using-Aspnet/https://www.aspforums.net:443/Threads/526478/Word-Document-Using-Aspnet/Tue, 22 Sep 2015 02:23:09 GMTWhat Software or API is needed to integrate Barcode Scanner in ASP.Net Website<p>hi</p> <p>&nbsp;please guide me the right way to using barcode scanner integrated into existing or new vb.net application.&nbsp;</p>https://www.aspforums.net:443/Threads/868473/What-Software-or-API-is-needed-to-integrate-Barcode-Scanner-in-ASPNet-Website/https://www.aspforums.net:443/Threads/868473/What-Software-or-API-is-needed-to-integrate-Barcode-Scanner-in-ASPNet-Website/Thu, 23 May 2013 04:46:28 GMTWhat is Spring.Net and how to use it in ASP.Net<p><span>Hello,</span><br /><span>&nbsp;</span><br /><span>I heard the concept&nbsp;</span><strong>Spring in JAVA</strong><span>, but I found that, we have&nbsp;</span><strong>Spring in .Net also</strong><span>.</span><br /><span>If it is there,</span><strong>&nbsp;then what is it and how to use?</strong><br /><strong>Why should I use Spring.Net?<br />What will be the advantages?</strong><br /><span>&nbsp;</span><br /><span>Thank you in advance...........</span></p>https://www.aspforums.net:443/Threads/307750/What-is-SpringNet-and-how-to-use-it-in-ASPNet/https://www.aspforums.net:443/Threads/307750/What-is-SpringNet-and-how-to-use-it-in-ASPNet/Wed, 26 Jun 2013 01:53:52 GMTWhat is OCR template and how to use it in .net application<p>i need to implement application using ocr template&nbsp; ,i am new to this concept</p> <p>so will u give any tutorial related to ocr template using rad controls ? my task is using rad controls</p> <p>in grid grid view i need to display records from database then i have to do task on&nbsp; ocr template ?please give me related tutorials related ocr templates using rad controls?</p>https://www.aspforums.net:443/Threads/396143/What-is-OCR-template-and-how-to-use-it-in-net-application/https://www.aspforums.net:443/Threads/396143/What-is-OCR-template-and-how-to-use-it-in-net-application/Wed, 26 Jun 2013 01:49:27 GMTWatermark PDF using iTextSharp in ASP.Net<p>can you please tell me that how to add watermark to uploaded doc (pdf or image files).<br /><br />The workflow will be-<br /><br />User register at portal -&gt; user upload some required document (like financial proof or some kind) -&gt; When saving them to database -&gt; a watermark (predefined by admin at backend in admin panel as - Logo or Text) will be added to those uploaded document on top and bottom or wherever possible on the uploaded document.<br /><br />So in future when admin views the document uploaded by him in his account, it will be displayed with stamp or the whatermark. it will proof that the document is uploaded to server by user or whatever.&nbsp; :P<br /><br />Now, this we have found way to do in jpg, but in case of pdf its quite tough.. please guide.<br /><br />Thanks..:)</p>https://www.aspforums.net:443/Threads/825345/Watermark-PDF-using-iTextSharp-in-ASPNet/https://www.aspforums.net:443/Threads/825345/Watermark-PDF-using-iTextSharp-in-ASPNet/Wed, 10 Sep 2014 04:59:01 GMTVideo is not playing with flow player in ASP.Net<p>Hi&nbsp;</p> <p>I am storing the .mp4 video in the videos folder which i have created in the solution explorer and storing the name,path in the database. Fetching the video and appending in the DataList. But the video is not playing, I am using flowplayer plugin</p> <p>Here is my code: </p> <pre class="brush: html">&lt;asp:DataList ID=&#34;DataList1&#34; Visible=&#34;true&#34; runat=&#34;server&#34; AutoGenerateColumns=&#34;false&#34; &nbsp;&nbsp;&nbsp;&nbsp;RepeatColumns=&#34;2&#34; CellSpacing=&#34;5&#34;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&lt;ItemTemplate&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;u&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;%# Eval(&#34;Name&#34;) %&gt;&lt;/u&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;hr /&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;a class=&#34;player&#34; style=&#34;height: 300px; width: 300px; display: block&#34; href=&#39;&lt;%# Eval(&#34;Path&#34;) %&gt;&#39;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/a&gt; &nbsp;&nbsp;&nbsp;&nbsp;&lt;/ItemTemplate&gt; &lt;/asp:DataList&gt; &lt;script src=&#34;FlowPlayer/flowplayer-3.2.12.min.js&#34; type=&#34;text/javascript&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34;&gt; flowplayer(&#34;a.player&#34;, &#34;http://releases.flowplayer.org/swf/flowplayer-3.2.16.swf&#34;, { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;plugins: { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pseudo: { url: &#34;FlowPlayer/flowplayer.pseudostreaming-3.2.12.swf&#34; } &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clip: { provider: &#39;pseudo&#39;, autoPlay: false}, &nbsp;&nbsp;&nbsp;&nbsp;}); &lt;/script&gt;</pre> <p>And on the page load i am binding the video </p> <pre class="brush: csharp">protected void Page_Load(object sender, EventArgs e) { &nbsp;&nbsp;&nbsp; if (!IsPostBack) &nbsp;&nbsp;&nbsp; { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BindGrid(); &nbsp;&nbsp;&nbsp; } } private void BindGrid() { &nbsp;&nbsp;&nbsp; string strConnString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString; &nbsp;&nbsp;&nbsp; using (SqlConnection con = new SqlConnection(strConnString)) &nbsp;&nbsp;&nbsp; { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using (SqlCommand cmd = new SqlCommand()) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cmd.CommandText = "select Id, Name, Path from videopath"; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cmd.Connection = con; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; con.Open(); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DataList1.DataSource = cmd.ExecuteReader(); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DataList1.DataBind(); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; con.Close(); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } &nbsp;&nbsp;&nbsp; } }</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/157689/Video-is-not-playing-with-flow-player-in-ASPNet/https://www.aspforums.net:443/Threads/157689/Video-is-not-playing-with-flow-player-in-ASPNet/Tue, 15 Nov 2016 00:31:45 GMTVerification of user using mobile number by sending 6 digit code as SMS in ASP.Net<p>Hi</p> <p>i want to add verification of user by sending 6 digit code to his mobile number during regisration .Tell me the way how can i do this.</p> <p>Thanks&nbsp;</p> <p>Puneet</p>https://www.aspforums.net:443/Threads/147777/Verification-of-user-using-mobile-number-by-sending-6-digit-code-as-SMS-in-ASPNet/https://www.aspforums.net:443/Threads/147777/Verification-of-user-using-mobile-number-by-sending-6-digit-code-as-SMS-in-ASPNet/Sat, 27 Apr 2013 23:34:35 GMTValidate DropDownCheckBoxes control using RequiredField validator in ASP.Net<p>This my code plz help me thank you</p> <pre class="brush: html">&lt;cc2:DropDownCheckBoxes ID=&#34;cblCustomerList&#34; runat=&#34;server&#34; Width=&#34;180px&#34;&gt; &lt;Style SelectBoxWidth=&#34;195&#34; DropDownBoxBoxWidth=&#34;160&#34; DropDownBoxBoxHeight=&#34;195&#34;/&gt; &lt;Items&gt; &lt;asp:ListItem Text = &#34;Kidneys Donor&#34; Value = &#34;Kidneys Donor&#34;&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Text = &#34;Lungs Donor&#34; Value = &#34;Lungs Donor&#34; &gt;Eye Donor&lt;/asp:ListItem&gt; &lt;asp:ListItem Text = &#34;Pancreas Donor&#34; Value = &#34;Pancreas Donor&#34; &gt;Blood Donor&lt;/asp:ListItem&gt; &lt;asp:ListItem Text = &#34;One&#34; Value = &#34;1&#34;&gt;Heart Donor&lt;/asp:ListItem&gt; &lt;asp:ListItem Text = &#34;One&#34; Value = &#34;1&#34; &gt;Liver Donor&lt;/asp:ListItem&gt; &lt;asp:ListItem &gt;Kidneys Donor&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;Lungs Donor&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;Pancreas Donor&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;Intestines Donor&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;Cornea Donor&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;Skin Donor&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;Heart Valves Donor&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;Tendons Donor&lt;/asp:ListItem&gt; &lt;/Items&gt; &lt;/cc2:DropDownCheckBoxes&gt; </pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/569986/Validate-DropDownCheckBoxes-control-using-RequiredField-validator-in-ASPNet/https://www.aspforums.net:443/Threads/569986/Validate-DropDownCheckBoxes-control-using-RequiredField-validator-in-ASPNet/Mon, 02 Feb 2015 22:17:52 GMTValidate ASP.Net DropDownList CheckBoxList Server control using JavaScript<p>Hi,</p> <p>How to validate&nbsp;DropDownCheckBoxes control at client side(javascript or Jquery)? I would like to restrict the user to submit the page if no item is selected in the dropdowncheckboxes control. i.e no check box is checked.</p> <p>Please provide the Javascript/Jquery code to validate the control at client side.</p> <p>&nbsp;</p> <p>Thanks and regards,</p> <p>Narender Charla</p>https://www.aspforums.net:443/Threads/771521/Validate-ASPNet-DropDownList-CheckBoxList-Server-control-using-JavaScript/https://www.aspforums.net:443/Threads/771521/Validate-ASPNet-DropDownList-CheckBoxList-Server-control-using-JavaScript/Wed, 29 Apr 2015 08:05:39 GMTUnable to open large PDF files in browser in ASP.Net<p>&nbsp;<a href="http://aspsnippets.com/Articles/Retrieve-and-display-PDF-Files-from-database-in-browser-in-ASPNet.aspx">http://aspsnippets.com/Articles/Retrieve-and-display-PDF-Files-from-database-in-browser-in-ASPNet.aspx</a></p> <p>I tried your article which is very helpful but I can't open large .pdf file with it where is the problem</p>https://www.aspforums.net:443/Threads/205114/Unable-to-open-large-PDF-files-in-browser-in-ASPNet/https://www.aspforums.net:443/Threads/205114/Unable-to-open-large-PDF-files-in-browser-in-ASPNet/Mon, 04 Aug 2014 05:16:43 GMTUnable to display PDF file in browser in ASP.Net<p>&nbsp;</p> <pre class="brush: html">&lt;asp:HyperLink ID=&#34;HyperLink7&#34; runat=&#34;server&#34; Target = &#34;_blank&#34; Text = &#34;Show PDF&#34; NavigateUrl = &#39;~/mypdf.pdf&#39;&gt;&lt;/asp:HyperLink&gt;</pre> <p>If I use this html code how to make the pdf file open in new tab in browser</p>https://www.aspforums.net:443/Threads/152303/Unable-to-display-PDF-file-in-browser-in-ASPNet/https://www.aspforums.net:443/Threads/152303/Unable-to-display-PDF-file-in-browser-in-ASPNet/Thu, 17 Jul 2014 01:20:26 GMTUltraWebGrid vs Gridview<p>I have using Ultrawebgrid in asp.net 2005&nbsp; i want replace gridview with same functionalty. its possible ? help please ...</p>https://www.aspforums.net:443/Threads/186298/UltraWebGrid-vs-Gridview/https://www.aspforums.net:443/Threads/186298/UltraWebGrid-vs-Gridview/Thu, 14 Jun 2012 01:55:16 GMTTrack when Email is opened and update database in ASP.Net<p>Hi,</p> <p>I want to know that after sending email to multiple users that how many mails are&nbsp;<strong>Bounced, Open, not open.</strong></p> <p>Please Can You Help me to implement code for how to track open mail and didn't open.</p> <p>Please Help me.</p> <p>Thanks in advance</p>https://www.aspforums.net:443/Threads/198453/Track-when-Email-is-opened-and-update-database-in-ASPNet/https://www.aspforums.net:443/Threads/198453/Track-when-Email-is-opened-and-update-database-in-ASPNet/Tue, 12 Dec 2017 23:21:23 GMTTo export the excel include table from above panel<p>I want to export the excel to the data from the asp.net page. When I export the data from the asp.net page the data are included from the the panel and not the table. My code is</p> <p>&nbsp;</p> <pre class="brush: html">&lt;table&gt; &lt;%--- &lt;tr class=&#34;graytitle&#34;&gt;--%&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:Label ID=&#34;LicenseNameLbl&#34; runat=&#34;server&#34;&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:Label ID=&#34;TitleLabel&#34; runat=&#34;server&#34; CssClass=&#34;Graytitle&#34; Text=&#34;Student Info -&#34;&gt;&lt;/asp:Label&gt; &amp;nbsp; &lt;asp:Label ID=&#34;TitleLbl&#34; runat=&#34;server&#34; CssClass=&#34;Graytitle&#34;&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:Label ID=&#34;StudentNameLabel&#34; runat=&#34;server&#34; class=&#34;graytitle&#34; Text=&#34;Student Name :&#34; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;asp:Label ID=&#34;NameLbl&#34; class=&#34;graytitle&#34; runat=&#34;server&#34;&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:Label ID=&#34;StudentCodeLabel&#34; runat=&#34;server&#34; class=&#34;graytitle&#34; Text=&#34;Student Code :&#34; /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;asp:Label ID=&#34;CodeLbl&#34; runat=&#34;server&#34; class=&#34;graytitle&#34;&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan=&#34;2&#34;&gt; &lt;asp:Button ID=&#34;excelImgBtn&#34; runat=&#34;server&#34; class=&#34;green&#34; Text=&#34;Excel&#34; OnClick=&#34;ButtonExcel_Click&#34; UseSubmitBehavior=&#34;false&#34; /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;</pre> <p>How can I describe the information to the excel format?</p> <p>My panel code is</p> <p>&nbsp;</p> <pre class="brush: html">&lt;asp:panel id=&#34;PanelResult&#34; runat=&#34;server&#34;&gt; &lt;/asp:panel&gt;</pre> <p>My back-end export excel code is</p> <pre class="brush: csharp"> protected void ExportToExcel() { Response.Clear(); Response.Buffer = true; Response.ContentType = &#34;application/vnd.ms-excel&#34;; Response.AddHeader(&#34;content-disposition&#34;, &#34;attachment;filename=StudentInfo.xls&#34;); Response.Charset = &#34;&#34;; this.EnableViewState = false; System.IO.StringWriter sw = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw); DataSet ds = (Session[&#34;StudentInfo_DS&#34;] == null) ? null : (DataSet)Session[&#34;StudentInfo_DS&#34;]; if (ds.Tables.Count &gt; 0) { int j = 0; for (int i = 0; i &lt; ds.Tables.Count; i++) { j = i + 1; GridView objGV = new GridView(); objGV.ID = &#34;ResultDG&#34; + j; objGV.AutoGenerateColumns = true; objGV.DataSource = ds.Tables[i]; objGV.DataBind(); objGV.RenderControl(htw); } } Response.Write(sw.ToString()); Response.End(); }</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/105866/To-export-the-excel-include-table-from-above-panel/https://www.aspforums.net:443/Threads/105866/To-export-the-excel-include-table-from-above-panel/Wed, 02 Jan 2019 22:41:37 GMTUsing XMLWorker to reference external css file in ASP.Net<p>I know&nbsp;&nbsp;I am mixing htmlworker and xmlworker horribly, please forgive.</p> <p>I had an htmlworker that I succeeded in converting to xmlworker.</p> <p>The big problem I am having is including css that you see at the bottom of the code so that the font size could be smaller than it currently shows when the PDF is generated.</p> <p>Could you please help me with making it complete xmlworker that calls an external css file?</p> <p>There is more code for the string body. I just put a small sample to show what I am trying to accomplish.</p> <p>Many thanks in advance</p> <p>&nbsp;</p> <pre class="brush: csharp">string body = &#34;&lt;br /&gt;&#34;; body = body + &#34;&lt;table border=&#39;1&#39; style=&#39;width:90%; text-align:left&#39;&gt;&#34;; body = body + &#34; &lt;tr&gt;&#34;; body = body + &#34; &lt;td style=&#39;width:20%&#39;&gt;Title: &lt;input name=&#39;txtTitle&#39; type=&#39;text&#39; id=&#39;txtTitle&#39; style=&#39;color: #0093B2;font-weight:bold;&#39; /&gt;&#34; + lblTitle.Text + &#34;&lt;/td&gt;&lt;td style=&#39;width:20%&#39;&gt;Preparer Name: &lt;input id=&#39;txtpreparerName&#39; style=&#39;color: #0093B2;font-weight:bold;&#39; /&gt;&#34; + lblpreparerName.Text + &#34;&lt;/td&gt;&lt;td style=&#39;width:20%&#39;&gt;Email: &lt;input name=&#39;txtEmail&#39; type=&#39;text&#39; id=&#39;txtEmail&#39; style=&#39;color: #0093B2;font-weight:bold;&#39; /&gt;&#34; + lblEmail.Text + &#34;&lt;/td&gt;&lt;td style=&#39;width:20%&#39;&gt;Date: &lt;span id=&#39;signDate&#39; style=&#39;color: #0093B2;font-weight:bold;&#39;&gt;&#34; + lblSignDate.Text + &#34;&lt;/span&gt;&lt;/td&gt;&#34;; body = body + &#34; &lt;/tr&gt;&#34;; body = body + &#34; &lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&#34;; body = body + &#34; &lt;br /&gt;&lt;br /&gt;&#34;; StringReader sr = new StringReader(body.ToString()); Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 10f, 0f); HTMLWorker htmlparser = new HTMLWorker(pdfDoc); iTextSharp.tool.xml.pipeline.css.ICSSResolver CSSResolver = XMLWorkerHelper.GetInstance().GetDefaultCssResolver(true); using (MemoryStream memoryStream = new MemoryStream()) { PdfWriter writer = PdfWriter.GetInstance(pdfDoc, memoryStream); pdfDoc.Open(); var xmlWorkerHelper = XMLWorkerHelper.GetInstance(); var cssResolver = new StyleAttrCSSResolver(); var xmlWorkerFontProvider = new XMLWorkerFontProvider(); foreach (string font in fonts) { xmlWorkerFontProvider.Register(font); } var cssAppliers = new CssAppliersImpl(xmlWorkerFontProvider); var htmlContext = new HtmlPipelineContext(cssAppliers); htmlContext.SetTagFactory(Tags.GetHtmlTagProcessorFactory()); PdfWriterPipeline pdfWriterPipeline = new PdfWriterPipeline(pdfDoc, pdfWriter); HtmlPipeline htmlPipeline = new HtmlPipeline(htmlContext, pdfWriterPipeline); CssResolverPipeline cssResolverPipeline = new CssResolverPipeline(cssResolver, htmlPipeline); XMLWorker xmlWorker = new XMLWorker(cssResolverPipeline, true); //htmlparser.Parse(sr); XMLParser xmlParser = new XMLParser(xmlWorker); pdfDoc.Close(); byte[] bytes = memoryStream.ToArray(); memoryStream.Close(); //css body { font-family: Century Gothic; font-size: 10pt; color: #000000; } </pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/207099/Using-XMLWorker-to-reference-external-css-file-in-ASPNet/https://www.aspforums.net:443/Threads/207099/Using-XMLWorker-to-reference-external-css-file-in-ASPNet/Thu, 22 Mar 2018 01:15:38 GMTUsing iTextSharp to change Page Extraction property to allow in ASP.Net<p>Hi,</p> <p>This question is based on the plugin itextsharp. I need to change only the pdf extraction properties. Rest of the property I can able to change. Please see my code below after the image which is taken from below site. The Actual issue was well explained in below link.</p> <p>&nbsp;https://developers.itextpdf.com/question/how-allow-page-extraction-when-setting-password-security</p> <p><img src="https://i.imgur.com/638NDCE.jpg" alt="" width="472" height="480" /></p> <p>&nbsp;</p> <pre class="brush: csharp">using iTextSharp.text.pdf; using (Stream input = new FileStream(InputFile, FileMode.Open, FileAccess.Read, FileShare.Read)) { using (Stream output = new FileStream(OutputFile, FileMode.Create, FileAccess.Write, FileShare.None)) { PdfReader reader = new PdfReader(input); PdfEncryptor.Encrypt(reader, output, true, userpwd, masterpwd,PdfWriter.AllowScreenReaders); } }</pre>https://www.aspforums.net:443/Threads/396111/Using-iTextSharp-to-change-Page-Extraction-property-to-allow-in-ASPNet/https://www.aspforums.net:443/Threads/396111/Using-iTextSharp-to-change-Page-Extraction-property-to-allow-in-ASPNet/Thu, 21 Dec 2017 04:41:49 GMTUsing Fusion Flash charts in ASP.Net<p><span id="result_box" lang="en"><span class="hps">Hello</span> <span class="hps">friends, I am</span> <span class="hps">looking for an example</span> <span class="hps">of</span> <span class="hps">how</span> <span class="hps">Asp.Net</span> <span class="hps">and</span> <span class="hps">FusionChart</span> <span class="hps">work</span>, someone <span class="hps">has an example</span> <span class="hps">to get started.</span> <br /><br /><strong><span class="hps">Thank you for your help</span></strong></span></p>https://www.aspforums.net:443/Threads/205044/Using-Fusion-Flash-charts-in-ASPNet/https://www.aspforums.net:443/Threads/205044/Using-Fusion-Flash-charts-in-ASPNet/Sun, 02 Nov 2014 21:46:29 GMTUse External CSS with iTextSharp while export to PDF using VB.Net in ASP.Net <p>I need to use External CSS file whle creating pdf from HTML page using Itext sharp in vb.net.&nbsp;</p> <p>Can you please help me in this?</p>https://www.aspforums.net:443/Threads/188648/Use-External-CSS-with-iTextSharp-while-export-to-PDF-using-VBNet-in-ASPNet/https://www.aspforums.net:443/Threads/188648/Use-External-CSS-with-iTextSharp-while-export-to-PDF-using-VBNet-in-ASPNet/Tue, 06 Feb 2018 00:05:20 GMTUploadify sql server upload<p>hi</p> <p>i'm just wondering whether i can use uploaify for uploading huge lot of file in sql server db. I think uploadify is the right tool for my project but i new to programming. All i want is save file name, file type, file size and actual file into sql server when start uploading the files..</p> <p>&nbsp;</p> <p>any help appreciated</p> <p>thanks</p> <p>mohamed</p>https://www.aspforums.net:443/Threads/711015/Uploadify-sql-server-upload/https://www.aspforums.net:443/Threads/711015/Uploadify-sql-server-upload/Wed, 23 May 2012 04:45:48 GMTUpload a Word Document and display it for Review on Web page in ASP.Net<p>Hi, i would like to know how to show a uploaded document in asp.net for reviewing the documentation. Im making a website about review system as a class project and i would like to know how to code them.</p> <p>it would be a real pleasure if i could get some assist from you. thank you for your&nbsp; time.</p>https://www.aspforums.net:443/Threads/131647/Upload-a-Word-Document-and-display-it-for-Review-on-Web-page-in-ASPNet/https://www.aspforums.net:443/Threads/131647/Upload-a-Word-Document-and-display-it-for-Review-on-Web-page-in-ASPNet/Sun, 26 Nov 2017 23:08:01 GMTUpdate database when Email is opened (read) in ASP.Net<p>when send mail and receiver open the mail and click the linkat that time call another page and update a data base with data</p>https://www.aspforums.net:443/Threads/133650/Update-database-when-Email-is-opened-read-in-ASPNet/https://www.aspforums.net:443/Threads/133650/Update-database-when-Email-is-opened-read-in-ASPNet/Wed, 21 Jan 2015 04:29:57 GMTUnzip (Extract) a Zip file from Folder using C# .Net<p>Hello, I am using this article</p> <p><a href="http://www.aspsnippets.com/Articles/Upload-Unzip-and-Extract-contents-Zip-Archive-file-in-ASPNet-using-C-and-VBNet.aspx">http://www.aspsnippets.com/Articles/Upload-Unzip-and-Extract-contents-Zip-Archive-file-in-ASPNet-using-C-and-VBNet.aspx</a></p> <p>My question is on how to unzip file without the file upload, since there's no fieupload, the file will&nbsp;manually code behind.</p> <p>For example:</p> <p>file.zip, then it will be unzip in the folder files.</p> <p>The file.zip is fixed in code behind.</p> <p>Thanks</p>https://www.aspforums.net:443/Threads/209668/Unzip-Extract-a-Zip-file-from-Folder-using-C-Net/https://www.aspforums.net:443/Threads/209668/Unzip-Extract-a-Zip-file-from-Folder-using-C-Net/Tue, 17 Mar 2015 02:15:21 GMTUnable to cast object of type 'iTextSharp.text.html.simpleparser.IncTable' to type 'iTextSharp.text.IElement<p>Hi,</p> <p>&nbsp; &nbsp; I want to generate PDF at run time from my .net application. I have followed Author- Mudassar Khan's 1 of post for generating PDF from Asp.net.</p> <p>But, I receiving 1 error while running the code.</p> <p>Below is the error -&nbsp;</p> <p>Unable to cast object of type 'iTextSharp.text.html.simpleparser.IncTable' to type 'iTextSharp.text.IElement</p> <p>&nbsp;</p> <p>&nbsp;</p> <pre class="brush: csharp">StringBuilder sb = new StringBuilder(); // Header sb.Append(&#34;&lt;table width=&#39;100%&#39; cellspacing=&#39;0&#39; cellpadding=&#39;2&#39;&gt;&#34;); sb.Append(&#34;&lt;tr&gt;&lt;td align=&#39;center&#39; style=&#39;background-color: #18B5F0&#39; colspan = &#39;2&#39;&gt;&lt;b&gt;Data&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&#34;); sb.Append(&#34;&lt;tr&gt;&lt;td colspan = &#39;2&#39;&gt;&lt;/td&gt;&lt;/tr&gt;&#34;); sb.Append(&#34;&lt;tr&gt;&lt;td colspan = &#39;2&#39; &gt;&lt;b&gt;City: &lt;/b&gt;&#34;); sb.Append(drpCity.Text); sb.Append(&#34;&lt;/td&gt;&lt;/tr&gt;&#34;); sb.Append(&#34;&lt;tr&gt;&lt;td colspan = &#39;2&#39;&gt;&lt;b&gt;State : &lt;/b&gt;&#34;); sb.Append(drpState.Text); sb.Append(&#34;&lt;/td&gt;&lt;/tr&gt;&#34;); sb.Append(&#34;&lt;tr&gt;&lt;td colspan = &#39;2&#39;&gt;&lt;b&gt;Equipment : &lt;/b&gt;&#34;); sb.Append(drpEquip.Text); sb.Append(&#34;&lt;/td&gt;&lt;/tr&gt;&#34;); sb.Append(&#34;&lt;/table&gt;&#34;); sb.Append(&#34;&lt;br /&gt;&#34;); sb.Append(&#34;&lt;table border = &#39;1&#39;&gt;&#34;); sb.Append(&#34;&lt;tr&gt;&#34;); foreach (DataColumn column in dt.Columns) { sb.Append(&#34;&lt;th style = &#39;background-color: #D20B0C;color:#ffffff&#39;&gt;&#34;); sb.Append(column.ColumnName); sb.Append(&#34;&lt;/th&gt;&#34;); } sb.Append(&#34;&lt;/tr&gt;&#34;); foreach (DataRow row in dt.Rows) { sb.Append(&#34;&lt;tr&gt;&#34;); foreach (DataColumn column in dt.Columns) { sb.Append(&#34;&lt;td&gt;&#34;); sb.Append(row[column]); sb.Append(&#34;&lt;/td&gt;&#34;); } sb.Append(&#34;&lt;/tr&gt;&#34;); } //Export HTML String as PDF. StringReader sr = new StringReader(sb.ToString()); Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 10f, 0f); HTMLWorker htmlparser = new HTMLWorker(pdfDoc); PdfWriter writer = PdfWriter.GetInstance(pdfDoc, Response.OutputStream); pdfDoc.Open(); htmlparser.Parse(sr); pdfDoc.Close(); Response.ContentType = &#34;application/pdf&#34;; Response.AddHeader(&#34;content-disposition&#34;, &#34;attachment;filename=Data.pdf&#34;); Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Write(pdfDoc); Response.End();</pre> <p>Where Im doing wrong. Please, tell me.</p>https://www.aspforums.net:443/Threads/146973/Unable-to-cast-object-of-type-iTextSharptexthtmlsimpleparserIncTable-to-type-iTextSharptextIElement/https://www.aspforums.net:443/Threads/146973/Unable-to-cast-object-of-type-iTextSharptexthtmlsimpleparserIncTable-to-type-iTextSharptextIElement/Thu, 17 Dec 2015 04:10:27 GMTTinyMCE Localization: Using Language in TinyMCE Editor<p>please solve my problem client requirements integration google hindi input tools....</p> <pre class="brush: js"> &lt;script type=&#34;text/javascript&#34;&gt; tinyMCE.init({ mode: &#34;textareas&#34;, theme: &#34;advanced&#34;, //language: &#34;hi&#34;, language: &#39;hi&#39;, media_live_embeds: true, plugins: &#34;safari,spellchecker,style,layer,table,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,youtubeIframe&#34;, theme_advanced_buttons1: &#34;bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect&#34;, theme_advanced_buttons2: &#34;cut,copy,paste,pastetext,pasteword,|bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,insertdate,inserttime,preview,|,forecolor,backcolor&#34;, theme_advanced_buttons3: &#34;hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,youtubeIframe,advhr,|,ltr,rtl,|,fullscreen&#34;, theme_advanced_buttons4: &#34;insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage&#34;, content_css: &#34;css/custom_content.css&#34;, // theme_advanced_font_sizes: &#34;10px,12px,13px,14px,16px,18px,20px&#34;, // font_size_style_values: &#34;10px,12px,13px,14px,16px,18px,20px&#34;//, theme_advanced_toolbar_location: &#34;top&#34;, theme_advanced_toolbar_align: &#34;left&#34;, theme_advanced_statusbar_location: &#34;bottom&#34;, theme_advanced_resizing: false, template_external_list_url: &#34;js/template_list.js&#34;, external_link_list_url: &#34;js/link_list.js&#34;, external_image_list_url: &#34;js/image_list.js&#34;, media_external_list_url: &#34;js/media_list.js&#34;, height: 600, content_style: &#34;div, p { font-size: 15px; }&#34;, extended_valid_elements: &#34;object[width|height|classid|codebase],param[name|value],embed[src|type|width|height|flashva&#34;//, //content_css : &#34;http://www.myserver.com/css/content.css&#34; }); &lt;/script&gt;</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/129660/TinyMCE-Localization-Using-Language-in-TinyMCE-Editor/https://www.aspforums.net:443/Threads/129660/TinyMCE-Localization-Using-Language-in-TinyMCE-Editor/Mon, 11 Dec 2017 00:25:56 GMTTinyMCE code syntax highlighting plugin<p>hi<br />which are the existing plugins for add code blocks in TinyMCE?<br />thanks!</p>https://www.aspforums.net:443/Threads/195445/TinyMCE-code-syntax-highlighting-plugin/https://www.aspforums.net:443/Threads/195445/TinyMCE-code-syntax-highlighting-plugin/Sun, 14 Jul 2013 06:55:26 GMTSystem.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\maideen\Captures\CLPR-00138\0411'.<p>Mr.Mudassar</p> <p>I used your code</p> <h1 class="header"><a title="Capture Image (Photo) from Web Camera (Webcam) in ASP.Net using C# and VB.Net'a" href="http://www.aspsnippets.com/Articles/Capture-Image-Photo-from-Web-Camera-Webcam-in-ASPNet-using-C-and-VBNet.aspx">Capture Image (Photo) from Web Camera (Webcam) in ASP.Net using C# and VB.Net</a></h1> <p>It works fine. Thank you.&nbsp;</p> <p>I am working in student management system creating student id</p> <p>I need to change image name currently in date time</p> <p>Dim&nbsp;imageName&nbsp;As&nbsp;String&nbsp;=&nbsp;DateTime.Now.ToString("dd-MM-yy hh-mm-ss")</p> <p>I need the image name like "AL-00345/0615" based on student ID</p> <p>and also appear the image path in text box or seesion in order to save into database.</p> <p>Pls Help me.</p> <p>Thank you.</p>https://www.aspforums.net:443/Threads/188854/SystemIODirectoryNotFoundException-Could-not-find-a-part-of-the-path-CUsersmaideenCapturesCLPR-001380411/https://www.aspforums.net:443/Threads/188854/SystemIODirectoryNotFoundException-Could-not-find-a-part-of-the-path-CUsersmaideenCapturesCLPR-001380411/Mon, 04 Jan 2016 04:45:23 GMTsubgurim.net: The remote server returned an error: (403) Forbidden.<p>The following error is coming</p> <h2><em>The remote server returned an error: (403) Forbidden.</em></h2> <p><em>while working with google maps the code I have written for this is</em></p> <pre class="brush: csharp"> string fulladdress = string.Format(&#34;{0}.{1}.{2}&#34;, txtStreet.Text, txtCity.Text, txtCountry.Text); string skey = ConfigurationManager.AppSettings[&#34;googlemaps.subgurim.net&#34;]; //HttpWebRequest request = (HttpWebRequest)WebRequest.Create(fulladdress); //request.UseDefaultCredentials = true; GeoCode geocode; geocode = GMap1.getGeoCodeRequest(fulladdress); var glatlng = new Subgurim.Controles.GLatLng(geocode.Placemark.coordinates.lat, geocode.Placemark.coordinates.lng); GMap1.setCenter(glatlng, 16, Subgurim.Controles.GMapType.GTypes.Normal); var oMarker = new Subgurim.Controles.GMarker(glatlng); GMap1.addGMarker(oMarker);</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/127211/subgurimnet-The-remote-server-returned-an-error-403-Forbidden/https://www.aspforums.net:443/Threads/127211/subgurimnet-The-remote-server-returned-an-error-403-Forbidden/Tue, 22 Jul 2014 01:51:12 GMTStyle not applying while generating PDF using iTextsharp in ASP.Net<p>&nbsp;hi sir,</p> <p>&nbsp;</p> <p>It is displaying fine when it run on page. But when i generate pdf style not adding in html page and even image also showing in actual in size . I set text-align:center it showing left in pdf. please suggest how can i solve this issue .</p> <pre class="brush: html"> &lt;div&gt; &lt;asp:Panel ID=&#34;pnlPerson&#34; runat=&#34;server&#34;&gt; &lt;div id=&#34;divprint&#34; runat=&#34;server&#34; style=&#34;margin-top: 45px;&#34;&gt; &lt;div style=&#34;width: 100%&#34;&gt; &lt;div id=&#34;divBill&#34; runat=&#34;server&#34;&gt; &lt;table style=&#34;width: 100%; &#34;&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:Image ID=&#34;imgcompany&#34; runat=&#34;server&#34; Width=&#34;150px&#34; /&gt; &lt;/td&gt; &lt;td&gt; &lt;b&gt; &lt;asp:Label ID=&#34;lblcompanyname&#34; runat=&#34;server&#34; Text=&#34;Bill&#34; /&gt;&lt;/b&gt;&lt;br /&gt; &lt;asp:Label ID=&#34;lblfarmname&#34; runat=&#34;server&#34; Text=&#34;Bill&#34; /&gt;&lt;br /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;table style=&#34;width: 100%;&#34; class=&#34;example-table&#34; border=&#34;1&#34;&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:Label ID=&#34;lblcompaddress&#34; runat=&#34;server&#34; Text=&#34;&#34; /&gt; &lt;/td&gt; &lt;td&gt;GSTIN &lt;/td&gt; &lt;td&gt; &lt;asp:Label ID=&#34;lblGSTIN&#34; runat=&#34;server&#34; Text=&#34;&#34; /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:Label ID=&#34;lblcityname&#34; runat=&#34;server&#34; Text=&#34;&#34; /&gt;, &lt;asp:Label ID=&#34;lblstateadd&#34; runat=&#34;server&#34; Text=&#34;&#34; /&gt;&lt;/td&gt; &lt;td&gt;PAN No :- &lt;/td&gt; &lt;td&gt; &lt;asp:Label ID=&#34;lblcomppanno&#34; runat=&#34;server&#34; Text=&#34;&#34; /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Phone No.- &lt;asp:Label ID=&#34;lbllandlineno&#34; runat=&#34;server&#34; Text=&#34;&#34; /&gt;&lt;/td&gt; &lt;td&gt;Email :- &lt;/td&gt; &lt;td&gt; &lt;asp:Label ID=&#34;lblemail&#34; runat=&#34;server&#34; Text=&#34;&#34; /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Mobile No.- &lt;asp:Label ID=&#34;lblcontactno&#34; runat=&#34;server&#34; Text=&#34;&#34; /&gt;&lt;/td&gt; &lt;td&gt;Web :- &lt;/td&gt; &lt;td&gt; &lt;asp:Label ID=&#34;lblwebsite&#34; runat=&#34;server&#34; Text=&#34;&#34; /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;div&gt;BILL TO&lt;/div&gt; &lt;table style=&#34;width: 100%;&#34; border=&#34;1&#34;&gt; &lt;tr&gt; &lt;td style=&#34;width: 59%&#34; rowspan=&#34;2&#34;&gt; &lt;asp:Label ID=&#34;lbllitle&#34; runat=&#34;server&#34;&gt;&lt;/asp:Label&gt; &lt;asp:Label ID=&#34;lblname&#34; runat=&#34;server&#34;&gt;&lt;/asp:Label&gt;&lt;br /&gt; &lt;asp:Label ID=&#34;lbladdress&#34; runat=&#34;server&#34;&gt;&lt;/asp:Label&gt;&lt;br /&gt; &lt;asp:Label ID=&#34;lblState&#34; runat=&#34;server&#34;&gt;&lt;/asp:Label&gt;&lt;br /&gt; &lt;asp:Label ID=&#34;lblmobile&#34; runat=&#34;server&#34;&gt;&lt;/asp:Label&gt;&lt;br /&gt; &lt;asp:Label ID=&#34;lblclientEmail&#34; runat=&#34;server&#34;&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:Label ID=&#34;date&#34; runat=&#34;server&#34; Text=&#34;Bill Date :&#34;&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:Label ID=&#34;lbldate&#34; runat=&#34;server&#34;&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;vertical-align: top;&#34;&gt;Invoice No&amp;nbsp;:&lt;/td&gt; &lt;td style=&#34;padding-left: 23px&#34;&gt; &lt;asp:Label ID=&#34;lblbillnum&#34; runat=&#34;server&#34;&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;asp:GridView ID=&#34;gvservices&#34; runat=&#34;server&#34; AutoGenerateColumns=&#34;false&#34; Width=&#34;100%&#34; ShowHeaderWhenEmpty=&#34;true&#34;&gt; &lt;Columns&gt; &lt;asp:TemplateField&gt; &lt;HeaderStyle Width=&#34;50px&#34; Height=&#34;20px&#34; /&gt; &lt;HeaderTemplate&gt; SL# &lt;/HeaderTemplate&gt; &lt;ItemTemplate&gt; &lt;%#Container.DataItemIndex+1 %&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;asp:TemplateField ItemStyle-CssClass=&#34;testL&#34;&gt; &lt;HeaderTemplate&gt; Service Description &lt;/HeaderTemplate&gt; &lt;ItemTemplate&gt; &lt;%# Eval(&#34;Name&#34;) %&gt;&lt;br /&gt; ( &lt;%# Eval(&#34;Description&#34;) %&gt;) &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;asp:TemplateField ItemStyle-CssClass=&#34;test&#34; HeaderStyle-HorizontalAlign=&#34;Right&#34;&gt; &lt;HeaderTemplate&gt; Amount(in Rs.) &lt;/HeaderTemplate&gt; &lt;ItemTemplate&gt; &lt;asp:Label ID=&#34;lblamount&#34; runat=&#34;server&#34; Text=&#39;&lt;%# Eval(&#34;Amount&#34;) %&gt;&#39;&gt;&lt;/asp:Label&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;%-- &lt;asp:TemplateField ItemStyle-CssClass=&#34;test&#34; HeaderStyle-HorizontalAlign=&#34;Right&#34;&gt; &lt;HeaderTemplate&gt; Tax(in Rs.) &lt;/HeaderTemplate&gt; &lt;ItemTemplate&gt; &lt;asp:Label ID=&#34;lbltax&#34; runat=&#34;server&#34; Text=&#39;&lt;%# Eval(&#34;TaxAmount&#34;) %&gt;&#39;&gt;&lt;/asp:Label&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;asp:TemplateField ItemStyle-CssClass=&#34;test&#34; HeaderStyle-HorizontalAlign=&#34;Right&#34;&gt; &lt;HeaderTemplate&gt; Total Amount(in Rs.) &lt;/HeaderTemplate&gt; &lt;ItemTemplate&gt; &lt;asp:Label ID=&#34;lblsumamount&#34; runat=&#34;server&#34; Text=&#39;&lt;%# Eval(&#34;TotalsumAmount&#34;) %&gt;&#39;&gt;&lt;/asp:Label&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt;--%&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; &lt;table style=&#34;width: 100%;&#34; border=&#34;1&#34;&gt; &lt;tr id=&#34;tr1&#34; runat=&#34;server&#34;&gt; &lt;td style=&#34;text-align: right&#34; colspan=&#34;2&#34;&gt; &lt;asp:Label ID=&#34;rstotal&#34; runat=&#34;server&#34; Text=&#34; Total amount&#34; Style=&#34;text-align: right; padding-right: 60px&#34;&gt;&lt;/asp:Label&gt; &lt;asp:Label ID=&#34;lbltotal&#34; runat=&#34;server&#34; Style=&#34;padding-right: 2px&#34;&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr id=&#34;trsgst&#34; runat=&#34;server&#34; visible=&#34;false&#34; style=&#34;text-align: right;&#34;&gt; &lt;td style=&#34;padding-right: 19px;&#34;&gt;SGST &lt;/td&gt; &lt;td&gt; &lt;asp:Label ID=&#34;lblsgst&#34; runat=&#34;server&#34; Text=&#34;0.00&#34;&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr id=&#34;trCGST&#34; runat=&#34;server&#34; visible=&#34;false&#34; style=&#34;text-align: right;&#34;&gt; &lt;td style=&#34;padding-right: 19px;&#34;&gt;CGST &lt;/td&gt; &lt;td&gt; &lt;asp:Label ID=&#34;lblCGST&#34; runat=&#34;server&#34; Text=&#34;0.00&#34;&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr id=&#34;trIGST&#34; runat=&#34;server&#34; visible=&#34;false&#34; style=&#34;text-align: right;&#34;&gt; &lt;td style=&#34;padding-right: 19px;&#34;&gt;IGST &lt;/td&gt; &lt;td&gt; &lt;asp:Label ID=&#34;lblIGST&#34; runat=&#34;server&#34; Text=&#34;0.00&#34;&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr id=&#34;trUTGST&#34; runat=&#34;server&#34; visible=&#34;false&#34; style=&#34;text-align: right;&#34;&gt; &lt;td style=&#34;padding-right: 19px;&#34;&gt;UTGST &lt;/td&gt; &lt;td&gt; &lt;asp:Label ID=&#34;lblUTGST&#34; runat=&#34;server&#34; Text=&#34;0.00&#34;&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;/tr&gt; &lt;%-- &lt;tr id=&#34;trAdvMgmt&#34; runat=&#34;server&#34; visible=&#34;false&#34;&gt; &lt;td style=&#34;text-align: right;padding-right: 19px;&#34;&gt; &lt;asp:Label ID=&#34;lbladvR&#34; runat=&#34;server&#34; Text=&#34;Advance Received&#34; &gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:Label ID=&#34;lblArAmt&#34; runat=&#34;server&#34;&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr id=&#34;tr3&#34; runat=&#34;server&#34;&gt; &lt;td style=&#34;text-align: right;padding-right: 19px;&#34;&gt; &lt;asp:Label ID=&#34;lblPaidAmtTitle&#34; runat=&#34;server&#34; Text=&#34;Paid Amount&#34; Visible=&#34;false&#34;&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:Label ID=&#34;lblPaidAmt&#34; runat=&#34;server&#34; Style=&#34;padding-right: 1px&#34; Visible=&#34;false&#34;&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td style=&#34;text-align: right;&#34;&gt; &lt;asp:Label ID=&#34;lblcardname&#34; runat=&#34;server&#34; Text=&#34;&#34;&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;/tr&gt;--%&gt; &lt;tr id=&#34;tr4&#34; runat=&#34;server&#34;&gt; &lt;td style=&#34;text-align: right; padding-right: 19px;&#34; width=&#34;85%&#34;&gt; &lt;asp:Label ID=&#34;lblt&#34; runat=&#34;server&#34; Text=&#34;Net Amount &#34;&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;td style=&#34;text-align: right&#34;&gt; &lt;asp:Label ID=&#34;lblfinalamt&#34; runat=&#34;server&#34;&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr id=&#34;tr5&#34; runat=&#34;server&#34;&gt; &lt;td style=&#34;text-align: right; padding-right: 19px;&#34;&gt; &lt;asp:Label ID=&#34;Label2&#34; runat=&#34;server&#34; Text=&#34;Amount Paid &#34;&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;td style=&#34;text-align: right&#34;&gt; &lt;asp:Label ID=&#34;lbladvance&#34; runat=&#34;server&#34;&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr id=&#34;tr6&#34; runat=&#34;server&#34;&gt; &lt;td style=&#34;text-align: right; padding-right: 19px;&#34;&gt; &lt;asp:Label ID=&#34;lblpayableamt&#34; runat=&#34;server&#34; Text=&#34;Total Professional Fees Due &#34;&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;td style=&#34;text-align: right&#34;&gt; &lt;asp:Label ID=&#34;lblpayable&#34; runat=&#34;server&#34;&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;br /&gt; &lt;/div&gt; &lt;div style=&#34;width: 100%&#34; id=&#34;divReceipt&#34; runat=&#34;server&#34;&gt; &lt;table style=&#34;width: 100%;&#34;&gt; &lt;tr&gt; &lt;td c style=&#34;text-align: center; font-weight: bold&#34;&gt; &lt;asp:Label ID=&#34;lblreceiptTilte&#34; runat=&#34;server&#34; Text=&#34;RECEIPT&#34; /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:Label ID=&#34;lblr&#34; runat=&#34;server&#34; Text=&#34;Receipt Number:&#34;&gt;&lt;/asp:Label&gt; &lt;asp:Label ID=&#34;lblrecptnNum&#34; runat=&#34;server&#34; Text=&#34;...&#34;&gt;&lt;/asp:Label&gt; &lt;asp:Label ID=&#34;reciept&#34; runat=&#34;server&#34; Text=&#34;Receipt Date:&#34; Style=&#34;padding-left: 300px;&#34;&gt;&lt;/asp:Label&gt; &lt;asp:Label ID=&#34;lblRcdate&#34; runat=&#34;server&#34;&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:Label ID=&#34;lblnarr&#34; runat=&#34;server&#34; Text=&#34;Received with thanks from&#34; /&gt;&amp;nbsp &lt;asp:Label ID=&#34;lbtitle&#34; runat=&#34;server&#34;&gt;&lt;/asp:Label&gt; &lt;asp:Label ID=&#34;lblrecepitfrom&#34; runat=&#34;server&#34;&gt;&lt;/asp:Label&gt; a sum of Rupees &lt;asp:Label ID=&#34;lblammount&#34; runat=&#34;server&#34;&gt;&lt;/asp:Label&gt; (&lt;asp:Label ID=&#34;lblSumofRupees&#34; runat=&#34;server&#34;&gt;&lt;/asp:Label&gt;) &lt;asp:Label ID=&#34;lblfor&#34; runat=&#34;server&#34; Text=&#34;against Bill No &#34;&gt;&lt;/asp:Label&gt;&lt;asp:Label ID=&#34;lblbla&#34; runat=&#34;server&#34;&gt;&lt;/asp:Label&gt; &lt;asp:Label ID=&#34;lblto&#34; runat=&#34;server&#34; Text=&#34;to&#34; Visible=&#34;false&#34; /&gt; &lt;asp:Label ID=&#34;lbtitleRefund&#34; runat=&#34;server&#34; Visible=&#34;false&#34; /&gt; &lt;asp:Label ID=&#34;lblrecepitfromRefund&#34; runat=&#34;server&#34; Visible=&#34;false&#34;&gt;&lt;/asp:Label&gt; &lt;asp:Label ID=&#34;lblCompAccountMsg&#34; runat=&#34;server&#34; /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;div style=&#34;height: 100px; text-align: right; height: 50px;&#34;&gt; &lt;asp:Label ID=&#34;lblsignature&#34; runat=&#34;server&#34; Style=&#34;text-align: right&#34;&gt;&lt;/asp:Label&gt; &lt;br /&gt; &lt;br /&gt; &lt;asp:Label ID=&#34;lblDesignation&#34; runat=&#34;server&#34; Text=&#34;Authorized Signatory&#34; Style=&#34;text-align: right&#34;&gt;&lt;/asp:Label&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id=&#34;dvtermcondition&#34; runat=&#34;server&#34;&gt; &lt;/div&gt; &lt;%--&lt;table style=&#34;width: 100%; font-size: 11px;&#34;&gt; &lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;1. Payment terms : The payments should be released within seven day&#39;s of completion of the activity.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;2. All Cheque should be drawn &#34; A/C payee&#34; only &amp; in favour of &lt;asp:Label ID=&#34;lblcompname&#34; runat=&#34;server&#34; Style=&#34;font-weight: bold;&#34;&gt;&lt;/asp:Label&gt; only. &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:Label ID=&#34;lblpanno&#34; runat=&#34;server&#34; Style=&#34;font-weight: bold;&#34;&gt;&lt;/asp:Label&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:Label ID=&#34;lblactno&#34; runat=&#34;server&#34; Style=&#34;font-weight: bold;&#34;&gt;&lt;/asp:Label&gt; &lt;asp:Label ID=&#34;lblbankname&#34; runat=&#34;server&#34; Style=&#34;font-weight: bold;&#34;&gt;&lt;/asp:Label&gt;, &lt;asp:Label ID=&#34;lblstaten&#34; runat=&#34;server&#34; Style=&#34;font-weight: bold;&#34;&gt;&lt;/asp:Label&gt; &lt;asp:Label ID=&#34;lblifsc&#34; runat=&#34;server&#34; Style=&#34;font-weight: bold;&#34;&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;--%&gt; &lt;/div&gt; &lt;/asp:Panel&gt; &lt;/div&gt; &lt;br /&gt; &lt;br /&gt; &lt;div style=&#34;margin-left: 40%;&#34;&gt; &lt;asp:ImageButton ID=&#34;btnprint&#34; runat=&#34;server&#34; CssClass=&#34;&#34; ImageUrl=&#34;~/images/print_button.png&#34; Width=&#34;100&#34; OnClientClick=&#34;javascript:PrintPage();&#34; /&gt; &lt;asp:Button ID=&#34;btbBack&#34; runat=&#34;server&#34; CssClass=&#34;btn&#34; Text=&#34;Back&#34; OnClick=&#34;btnBack_Click&#34; /&gt;&lt;br /&gt; &lt;asp:Button ID=&#34;btngenpdf&#34; runat=&#34;server&#34; CssClass=&#34;btn&#34; Text=&#34;Send Mail with attachement&#34; OnClick=&#34;btngenpdf_Click&#34; /&gt; &lt;/div&gt; &lt;asp:Label ID=&#34;lblmsg&#34; runat=&#34;server&#34; /&gt; &lt;asp:HiddenField ID=&#34;hdnclientemail&#34; runat=&#34;server&#34; /&gt; &lt;asp:HiddenField ID=&#34;hdncleitnid&#34; runat=&#34;server&#34; /&gt; &lt;asp:HiddenField ID=&#34;hdnIsunionter&#34; runat=&#34;server&#34; /&gt; &lt;asp:HiddenField ID=&#34;hdncompstateID&#34; runat=&#34;server&#34; /&gt; &lt;asp:HiddenField ID=&#34;hdnClientstateID&#34; runat=&#34;server&#34; /&gt; &lt;asp:HiddenField ID=&#34;hdnpassword&#34; runat=&#34;server&#34; /&gt;</pre> <p>&nbsp;</p> <pre class="brush: csharp"> int userid = 0; int taskID = 0; string BillNo = string.Empty; string RecptNo = string.Empty; string clienttype = string.Empty; DataTable dtservice; void Page_Init(object sender, EventArgs e) { if (Request.QueryString.AllKeys.Contains(&#34;clientID&#34;)) { int id; int.TryParse(Request.QueryString[&#34;clientID&#34;], out id); hdncleitnid.Value = id.ToString(); clienttype = Request.QueryString[&#34;clienttype&#34;]; BillNo = Request.QueryString[&#34;InvoiceNo&#34;]; RecptNo = Request.QueryString[&#34;recpNo&#34;]; if (string.IsNullOrEmpty(RecptNo)) { divReceipt.Visible = false; } ViewState[&#34;ClientID&#34;] = id; } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // Addcolumnsservices(); GetUserInformation(); GetBillDetailsByRecpt(); } } private void GetUserInformation() { // ViewState[&#34;ClientID&#34;] = hdncleitnid.Value; string strConnString = ConfigurationManager.ConnectionStrings[&#34;MSIS_SQLConnection&#34;].ConnectionString; DataTable dt = new DataTable(); using (SqlConnection con = new SqlConnection(strConnString)) { // string strQuery = &#34;select u.Address,U.Name,U.Mobile,u.EmailID, ud.NAME as State,U.State as StateID,UD.Isunionterritories from ClientMaster U join STATE UD on U.State = ud.ID where U.ID =&#34; + ViewState[&#34;ClientID&#34;] + &#34;&#34;; string strQuery = &#34;&#34;; if (clienttype== &#34;NEW&#34;) { strQuery = &#34;select u.Address,U.Name,U.Mobile,u.City,u.Email as EmailID ,u.State as StateID,UD.Isunionterritories, ud.NAME as State from NewClient U left outer join STATE UD on U.State = ud.ID where U.ID =&#34; + hdncleitnid.Value + &#34;&#34;; } else { strQuery = &#34;select u.Address,U.Name,U.Mobile,u.City,u.EmailID ,u.State as StateID,UD.Isunionterritories, ud.NAME as State from ClientMaster U left outer join STATE UD on U.State = ud.ID where U.ID =&#34; + hdncleitnid.Value + &#34;&#34;; } SqlCommand cmd = new SqlCommand(strQuery); using (SqlDataAdapter sda = new SqlDataAdapter()) { cmd.Connection = con; con.Open(); sda.SelectCommand = cmd; sda.Fill(dt); if (dt.Rows.Count &gt; 0) { lblname.Text = dt.Rows[0][&#34;Name&#34;].ToString(); lbladdress.Text = dt.Rows[0][&#34;Address&#34;].ToString(); lblmobile.Text = &#34;Mobile No. : &#34; + dt.Rows[0][&#34;Mobile&#34;].ToString(); lblState.Text = dt.Rows[0][&#34;State&#34;].ToString(); lblbillnum.Text = BillNo; lblrecptnNum.Text = RecptNo; hdnClientstateID.Value = dt.Rows[0][&#34;StateID&#34;].ToString(); hdnclientemail.Value = dt.Rows[0][&#34;EmailID&#34;].ToString(); lblclientEmail.Text = &#34; Email : &#34; + dt.Rows[0][&#34;EmailID&#34;].ToString(); hdnIsunionter.Value = dt.Rows[0][&#34;Isunionterritories&#34;].ToString(); } } } // lblinvoiceno.Text = recptNo; } private void GetBillDetailsByRecpt() { TaskListBL taskListBL = new TaskListBL(); DataSet dsTaskList = taskListBL.GetBillDetailsByRecpt(BillNo, RecptNo); if (dsTaskList.Tables[0].Rows.Count &gt; 0) { gvservices.DataSource = dsTaskList; gvservices.DataBind(); DataRow row = dsTaskList.Tables[0].Rows[0]; hdncompstateID.Value = row[&#34;State&#34;].ToString(); lblRcdate.Text = lbldate.Text = row[&#34;GenerateDate&#34;].ToString(); lblcompanyname.Text = row[&#34;CompanyName&#34;].ToString(); lblfarmname.Text = row[&#34;FarmName&#34;].ToString(); // string host = HttpContext.Current.Request.Url.Authority; String strPathAndQuery = HttpContext.Current.Request.Url.PathAndQuery; String strUrl = HttpContext.Current.Request.Url.AbsoluteUri.Replace(strPathAndQuery, &#34;/&#34;); imgcompany.ImageUrl = strUrl + &#34;images/CopmanyLogo/&#34; + row[&#34;LogoName&#34;].ToString(); lblcityname.Text = row[&#34;City&#34;].ToString(); lblstateadd.Text = lblState.Text = row[&#34;StateName&#34;].ToString(); // lblcomppanno.Text= lblpanno.Text = row[&#34;PANNo&#34;].ToString(); lblGSTIN.Text = row[&#34;ServiceTaxNo&#34;].ToString(); dvtermcondition.InnerHtml = row[&#34;TermsContidion&#34;].ToString(); // lblactno.Text = &#34;A/C No. &#34; + row[&#34;ACTNO&#34;].ToString(); // lblbankname.Text = &#34; held with &#34; + row[&#34;BankName&#34;].ToString(); lblcompaddress.Text = row[&#34;Address&#34;].ToString(); lblemail.Text = row[&#34;Email&#34;].ToString(); lblcontactno.Text = row[&#34;ContactNo&#34;].ToString(); hdnpassword.Value = row[&#34;Password&#34;].ToString(); lblwebsite.Text = &#34;Website : &#34; + row[&#34;Website&#34;].ToString(); //lblbillfrom.Text = row[&#34;CompanyName&#34;].ToString(); decimal total = 0; // Label lbltotalamt = (Label)gridBdetails.FooterRow.FindControl(&#34;lbltotalamt&#34;); foreach (GridViewRow gridViewRow in gvservices.Rows) { Label totalval = (Label)gridViewRow.FindControl(&#34;lblamount&#34;); decimal rowValue = 0; if (decimal.TryParse(totalval.Text.Trim(), out rowValue)) total += rowValue; } lbltotal.Text = total.ToString(); // lbltotal.Text = row[&#34;TotalAmount&#34;].ToString(); lblsgst.Text = dsTaskList.Tables[0].Compute(&#34;SUM(SGST)&#34;, string.Empty).ToString();// row[&#34;SGST&#34;].ToString(); lblCGST.Text = dsTaskList.Tables[0].Compute(&#34;SUM(CGST)&#34;, string.Empty).ToString();// row[&#34;CGST&#34;].ToString(); lblIGST.Text = dsTaskList.Tables[0].Compute(&#34;SUM(IGST)&#34;, string.Empty).ToString();// row[&#34;IGST&#34;].ToString(); lblUTGST.Text = dsTaskList.Tables[0].Compute(&#34;SUM(UTGST)&#34;, string.Empty).ToString();// row[&#34;UTGST&#34;].ToString(); lblfinalamt.Text = row[&#34;FinalValue&#34;].ToString(); decimal ammount = Convert.ToDecimal(row[&#34;FinalValue&#34;]); int amt = Convert.ToInt32(ammount); string mywrd = AppUtility.NumbersToWords(amt); lblSumofRupees.Text = mywrd + &#34; only&#34;; lblbla.Text = BillNo; lbladvance.Text = row[&#34;AdvanceAmount&#34;].ToString(); lblpayable.Text = row[&#34;payableamt&#34;].ToString(); lblsignature.Text = row[&#34;CompanyName&#34;].ToString(); //lblifsc.Text = &#34; (IFSC Code # &#34; + row[&#34;IFSCCode&#34;].ToString() + &#34; )&#34;; DisplayTaxType(); } } protected void btngenpdf_Click(object sender, EventArgs e) { btngenpdf.Visible = false; btbBack.Visible = false; btnprint.Visible = false; Response.ContentType = &#34;application/pdf&#34;; Response.AddHeader(&#34;content-disposition&#34;, &#34;attachment;filename=&#34; + lblbillnum.Text + &#34;.pdf&#34;); Response.Cache.SetCacheability(HttpCacheability.NoCache); StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); pnlPerson.RenderControl(hw); StringReader sr = new StringReader(sw.ToString()); string host = HttpContext.Current.Request.Url.Host; Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 100f, 0f); HTMLWorker htmlparser = new HTMLWorker(pdfDoc); PdfWriter.GetInstance(pdfDoc, Response.OutputStream); using (MemoryStream memoryStream = new MemoryStream()) { PdfWriter writer = PdfWriter.GetInstance(pdfDoc, memoryStream); pdfDoc.Open(); htmlparser.Parse(sr); pdfDoc.Close(); //Response.Write(pdfDoc); //Response.End(); byte[] bytes = memoryStream.ToArray(); memoryStream.Close(); // MailMessage mm = new MailMessage(&#34;info@cabmsa.in&#34;,&#34;singh.satan@gmail.com&#34;);// hdnclientemail.Value MailMessage mm = new MailMessage(lblemail.Text, hdnclientemail.Value); mm.To.Add(&#34;satansingh.jsp@gmail.com&#34;); mm.Subject = &#34;Invoce attachement&#34;; mm.Body = &#34;Invoice Attachment&#34;; mm.Attachments.Add(new Attachment(new MemoryStream(bytes), lblbillnum.Text + &#34;.pdf&#34;)); mm.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(); string smtpaddress = &#34;&#34;; // string hostdomain = &#34;&#34;; int portaddress = 0; string words = lblemail.Text.Split(&#39;@&#39;)[1]; // var valu = word[1]; // Console.WriteLine(word); if (words.ToLower() == &#34;gmail.com&#34;) { smtpaddress = &#34;smtp.gmail.com&#34;; portaddress = 587; smtp.EnableSsl = true; } else { smtpaddress = &#34;mail.&#34; + words.ToLower() + &#34;&#34;; portaddress = 25; smtp.EnableSsl = false; }; smtp.Host = smtpaddress; smtp.UseDefaultCredentials = false; // System.Net.NetworkCredential NetworkCred = new System.Net.NetworkCredential(); //NetworkCred.UserName = &#34;info@cabmsa.in&#34;; //NetworkCred.Password = &#34;welcome@123&#34;; NetworkCred.UserName = lblemail.Text; NetworkCred.Password = hdnpassword.Value; smtp.UseDefaultCredentials = false; smtp.Credentials = NetworkCred; smtp.Port = portaddress; smtp.Send(mm); } //pdfDoc.Open(); //htmlparser.Parse(sr); //pdfDoc.Close(); //Response.Write(pdfDoc); //Response.End(); btngenpdf.Visible = true; btbBack.Visible = true; btnprint.Visible = true; } protected void btngenpdf_Click1(object sender, EventArgs e) { ServicesBL servicesBL = new ServicesBL(); string strInvoiceNo = string.Empty; strInvoiceNo = BillNo; TaskListBL taskListBL = new TaskListBL(); DataSet dsState = taskListBL.GetBillDetailsByRecpt(BillNo, RecptNo); if (dsState.Tables[1] != null &amp;&amp; dsState.Tables[1].Rows.Count &gt; 0) { DataTable dt = dsState.Tables[1]; using (StringWriter sw = new StringWriter()) { using (HtmlTextWriter hw = new HtmlTextWriter(sw)) { StringBuilder sb = new StringBuilder(); //Generate Invoice (Bill) Header. sb.Append(&#34;&lt;table style=&#39;width: 100%;border: 1px solid Black;border-spacing: 0;font-size:14px&#39;&gt;&#34;); sb.Append(&#34; &lt;tr&gt;&lt;td style=&#39;text-align:center;&#39;&gt;&#34;); sb.Append(&#34;&lt;b style=&#39;font-size:25px;&#39;&gt;&#34; + lblcompanyname.Text + &#34; &lt;/b&gt;&lt;br&gt;&#34;); sb.Append(&#34;&lt;b style=&#39;font-size:20px;&#39;&gt;&#34; + lblfarmname.Text + &#34;&lt;/b&gt;&lt;br&gt;&#34;); sb.Append(&#34; &lt;b&gt;&#34; + lblcompaddress.Text + &#34;,&#34;); sb.Append(lblcityname.Text + &#34;,&#34;); sb.Append(lblstateadd.Text + &#34;,&lt;br&gt;&#34;); sb.Append(lblcontactno.Text + &#34;,&#34;); sb.Append(lblemail.Text + &#34;,&lt;br&gt;&#34;); sb.Append(lblwebsite.Text + &#34;&lt;/b&gt;&#34;); sb.Append(&#34;&lt;/td&gt;&lt;/tr&gt;&#34;); sb.Append(&#34;&lt;tr&gt;&lt;td style=&#39;border:1px solid Black; width: 70%;vertical-align: top&#39; colspan=&#39;2&#39;&gt;&#34;); sb.Append(&#34;&lt;table style=&#39;width: 100%; border:1px solid Black;&#39;&gt;&#34;); sb.Append(&#34;&lt;tr&gt;&lt;td&gt;Name :&lt;/td&gt;&#34;); sb.Append(&#34;&lt;td style=&#39;width: auto&#39;&gt;&lt;b&gt;&#34; + lbllitle.Text + &#34; &#34; + lblname.Text + &#34;&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&#34;); sb.Append(&#34;&lt;tr&gt;&lt;td style=&#39;font-size: 14px&#39;&gt;Address : &lt;/td&gt;&lt;td&gt;&#34; + lbladdress.Text + &#34;&lt;/td&gt; &lt;/tr&gt;&#34;); sb.Append(&#34; &lt;tr&gt;&lt;td style=&#39;width: 100px; font-size: 14px&#39;&gt;Mobile No:&lt;/td&gt;&lt;td&gt;&#34; + lblmobile.Text + &#34;&gt;&lt;/td&gt;&lt;/tr&gt;&#34;); sb.Append(&#34;&lt;tr&gt;&lt;td style=&#39;width: 100px; font-size: 14px&#39;&gt;State:&lt;/td&gt;&lt;td&gt;&#34; + lblState.Text + &#34;&lt;/td&gt;&lt;/tr&gt;&#34;); sb.Append(&#34;&lt;/table&gt;&lt;/td&gt;&#34;); sb.Append(&#34; &lt;td style=&#39;vertical-align: top; border-bottom: 1px solid Black; width: 80%;&#39; colspan=&#39;3&#39;&gt;&#34;); sb.Append(&#34;&lt;table style=&#39;width: 100%; font-size: 14px; border-spacing: 0;&#39;&gt;&#34;); sb.Append(&#34;&lt;tr&gt;&lt;td&gt;&#34;); sb.Append(&#34;&lt;table style=&#39;border-spacing: 0px&#39;&gt;&#34;); sb.Append(&#34;&lt;tr&gt;&lt;td style=&#39;vertical-align: top; font-size: 14px;&#39;&gt;Invoice No&amp;nbsp;:&lt;/td&gt;&#34;); sb.Append(&#34;&lt;td style=&#39;padding-left: 23px&#39;&gt;&lt;b&gt;&#34; + lblbillnum.Text + &#34;&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&#34;); sb.Append(&#34;&lt;tr&gt;&lt;td&gt;Bill Date :&lt;/td&gt;&lt;td style=&#39;padding-left: 23px&#39;&gt;&lt;b&gt;&#34; + lbldate.Text + &#34;&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&#34;); // sb.Append(&#34;&lt;tr&gt;&lt;td&gt;Bill From:&lt;/td&gt;&lt;td style=&#39;padding-left: 23px&#39;&gt;&#34;+ lblbillfrom.Text +&#34;&lt;/td&gt;&#34;); sb.Append(&#34;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&#34;); sb.Append(&#34;&lt;tr&gt;&lt;td colspan = &#39;2&#39;&gt;&lt;/td&gt;&lt;/tr&gt;&#34;); sb.Append(&#34;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Invoice No: &lt;/b&gt;&#34;); sb.Append(strInvoiceNo); sb.Append(&#34;&lt;/td&gt;&lt;td align = &#39;right&#39;&gt;&lt;b&gt;Date: &lt;/b&gt;&#34;); sb.Append(DateTime.Now); sb.Append(&#34; &lt;/td&gt;&lt;/tr&gt;&#34;); sb.Append(&#34;&lt;tr&gt;&lt;td colspan = &#39;2&#39;&gt;&lt;b&gt;Company Name: &lt;/b&gt;&#34;); sb.Append(&#34;satan&#34;); sb.Append(&#34;&lt;/td&gt;&lt;/tr&gt;&#34;); sb.Append(&#34;&lt;/table&gt;&#34;); sb.Append(&#34;&lt;br /&gt;&#34;); //Generate Invoice (Bill) Items Grid. sb.Append(&#34;&lt;table border = &#39;1&#39;&gt;&#34;); sb.Append(&#34;&lt;tr&gt;&#34;); foreach (DataColumn column in dt.Columns) { sb.Append(&#34;&lt;th style = &#39;bgcolor: #D20B0C;color:#ffffff&#39;&gt;&#34;); sb.Append(column.ColumnName); sb.Append(&#34;&lt;/th&gt;&#34;); } sb.Append(&#34;&lt;/tr&gt;&#34;); foreach (DataRow row in dt.Rows) { sb.Append(&#34;&lt;tr&gt;&#34;); foreach (DataColumn column in dt.Columns) { sb.Append(&#34;&lt;td&gt;&#34;); sb.Append(row[column]); sb.Append(&#34;&lt;/td&gt;&#34;); } sb.Append(&#34;&lt;/tr&gt;&#34;); } sb.Append(&#34;&lt;tr&gt;&lt;td align = &#39;right&#39;&gt;&#34;); sb.Append(dt.Columns.Count - 1); sb.Append(&#34;&#39;&gt;Total&lt;/td&gt;&#34;); sb.Append(&#34;&lt;td&gt;&#34;); //sb.Append(dt.Compute(&#34;sum(Total)&#34;, &#34;&#34;)); sb.Append(dt.Rows[0][&#34;TotalAmount&#34;].ToString()); sb.Append(&#34;&lt;/td&gt;&#34;); sb.Append(&#34;&lt;/tr&gt;&lt;/table&gt;&#34;); sb.Append(&#34; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#34;); //Export HTML String as PDF. StringReader sr = new StringReader(sb.ToString()); Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 10f, 0f); HTMLWorker htmlparser = new HTMLWorker(pdfDoc); using (MemoryStream memoryStream = new MemoryStream()) { PdfWriter writer = PdfWriter.GetInstance(pdfDoc, memoryStream); pdfDoc.Open(); htmlparser.Parse(sr); pdfDoc.Close(); byte[] bytes = memoryStream.ToArray(); memoryStream.Close(); MailMessage mm = new MailMessage(&#34;info@eagleinnovations.co.in&#34;, &#34;singh.satan@gmail.com&#34;); mm.Subject = &#34;QuickeServices&#34;; mm.Body = &#34;Invoice Attachment&#34;; mm.Attachments.Add(new Attachment(new MemoryStream(bytes), &#34;Invoice.pdf&#34;)); mm.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(); smtp.Host = &#34;mail.eagleinnovations.co.in&#34;; smtp.EnableSsl = true; System.Net.NetworkCredential NetworkCred = new System.Net.NetworkCredential(); NetworkCred.UserName = &#34;info@eagleinnovations.co.in&#34;; NetworkCred.Password = &#34;welcome@123&#34;; smtp.UseDefaultCredentials = false; smtp.EnableSsl = false; smtp.Credentials = NetworkCred; smtp.Port = 25; smtp.Send(mm); } } } } } public override void VerifyRenderingInServerForm(Control control) { /* Verifies that the control is rendered */ } private void DisplayTaxType() { if (hdnClientstateID.Value == hdncompstateID.Value) { trsgst.Visible = true; trCGST.Visible = true; trIGST.Visible = false; trUTGST.Visible = false; } else if (hdnIsunionter.Value == &#34;1&#34;) { trUTGST.Visible = true; trsgst.Visible = false; trCGST.Visible = false; trIGST.Visible = false; } else { trUTGST.Visible = false; trsgst.Visible = false; trCGST.Visible = false; trIGST.Visible = true; } } protected void btnBack_Click(object sender, EventArgs e) { Response.Redirect(&#34;givenServices.aspx&#34;); }</pre> <p>&nbsp;</p> <pre class="brush: css">&lt;style&gt; hr { display: block; -webkit-margin-before: 0.5em; -webkit-margin-after: 0.5em; -webkit-margin-start: auto; -webkit-margin-end: auto; } .test { text-align: right; } .testL { text-align: left; } &lt;/style&gt; &lt;script type=&#34;text/javascript&#34;&gt; function PrintPage() { document.getElementById(&#39;&lt;%=btnprint.ClientID%&gt;&#39;).style.visibility = &#34;hidden&#34;; document.getElementById(&#39;&lt;%=btbBack.ClientID%&gt;&#39;).style.visibility = &#34;hidden&#34;; window.print(); } &lt;/script&gt; &lt;style type=&#34;text/css&#34;&gt; table { border-collapse: collapse; } th, td { border: 1px solid #ccc; padding-left: 10px; } tr:nth-child(even) { background-color: #fff; } tr:nth-child(odd) { background-color: #fff; } &lt;/style&gt; </pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/132781/Style-not-applying-while-generating-PDF-using-iTextsharp-in-ASPNet/https://www.aspforums.net:443/Threads/132781/Style-not-applying-while-generating-PDF-using-iTextsharp-in-ASPNet/Tue, 16 Jan 2018 01:04:41 GMTSplit PDF into multiple PDFs using iTextsharp and C# in ASP.Net<p>Hiii,</p> <p>I want to open a pdf file from fileuploader's selected path and then priview it in same page (inside the div) .</p> <p>The PDF's contains the unique serial number in it like CGHS No:21345 .</p> <p>In that pdf if 10 pages are there with 10 unique numbers, i want to save each page saperately with that unique number as name to specified selected file path from fileuploader.</p>https://www.aspforums.net:443/Threads/202694/Split-PDF-into-multiple-PDFs-using-iTextsharp-and-C-in-ASPNet/https://www.aspforums.net:443/Threads/202694/Split-PDF-into-multiple-PDFs-using-iTextsharp-and-C-in-ASPNet/Mon, 03 Apr 2017 01:38:23 GMT