ASP.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a ASP.NET Expert!

Join 300,451 ASP.NET Programmers for FREE! Get instant access to thousands of ASP.NET experts, tutorials, code snippets, and more! There are 1,581 people online right now. Registration is fast and FREE... Join Now!




printer problem in asp.net

 

printer problem in asp.net, printer problem

banerji007

26 Jun, 2009 - 02:25 AM
Post #1

New D.I.C Head
*

Joined: 28 Jan, 2009
Posts: 1

Use the following code to get all printers. Thus the dropdownlist contains list of installed printers. If am saving Microsoft XPS Document Writer as my printer and try to print using the printer a window is opened for saving the print document.But when I host the application and try to print with Microsoft XPS Document Writer the page shows a javascript error or the page become struct.I think it is because if am selecting Microsoft XPS Document Writer as printer its not a valid printer and shows the dialog window to save the document but after hosting save window is opened and the timeout occurs therefore the errors occurs.If am selecting a valid printer it works fine. Can you help me to avoid Microsoft XPS Document Writer from my installed printers lisrt or help any way

//Get all the Installed printers
foreach (String strPrinterName in PrinterSettings.InstalledPrinters)
{
ddlSetPrinter.Items.Add(strPrinterName);
}

User is offlineProfile CardPM
+Quote Post


Jayman

RE: Printer Problem In Asp.net

26 Jun, 2009 - 06:59 AM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 8,544



Thanked: 226 times
Dream Kudos: 500
Expert In: Everything

My Contributions
Just don't add it to the DropDownList. I don't know how much easier it gets than that. Just test the Printer name before you add it, if it is XPS then don't add it.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 01:52AM

Live ASP.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

ASP.NET Tutorials

Reference Sheets

ASP.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month