You are coding an ASP.NET website which means that your code will run at server side
not at the client machine. I guess that you want to print the file to the client printer, right? If so, then that code you have there will not work as again, it'll be executed at the server machine where you'll host your site. If you want to print a file like PDF, doc, etc; then you could do one of the following: #1 Just let the user to open the file and let him/her to print it "manually"; #2 You could display the file in your web page using
Google Doc Viewer then print that iframe content by using window.print() javascript code; or #3 there are other tools that can make this happen like
this but it's not free, sadly.