Mukesh Kumar Tiwari

Mukesh Kumar Tiwari

  • NA
  • 980
  • 251.5k

How to print the value of text box in asp.net.

Oct 11 2013 7:37 AM
hi friends..

i ant to print the text of Multiline Textbox trough the printer when client click on print button.
I
I m using following code for that..

//======================
this is for bind the all printer of network in a dropdown
 String InstalledPrinters;
        for (int count = 0; count < PrinterSettings.InstalledPrinters.Count; count++)
        {
            InstalledPrinters = PrinterSettings.InstalledPrinters[count];
           DropDownList1.Items.Add(InstalledPrinters);
//=========

And this is for printing.......

 // prd.DocumentName = TextBox1.Text;


     

       
        prd.PrinterSettings.PrintFileName = "D://pd.txt";//here i want to print the valu of textbox
        prd.PrinterSettings.PrinterName = DropDownList1.Text;

        if (prd.PrinterSettings.IsValid)
        {

            //prd.Print();
        }
        else
        {
            Label1.Text = "invalid printer name";
        }

Thanks & Regards
Mukesh Tiwari

Answers (1)