You mean, you don't want to use "JavaScript". Java and JavaScript are not related to each other and have nothing in common.
You cannot know if a user actually printed. Printing is firmly in the hands of the user - a web developer cannot write code to force a user to print.
You can, however, create a "Print" button, and USING JAVASCRIPT, invoke the "window.print()" method when they press it. Again, USING JAVASCRIPT, you can author a hidden form variable, then submit the form. Your code-behind page would read the hidden form variable to know that the user clicked your "Print" button.
I know you said you didn't want "to use Java (sic)", but there is no way to do it otherwise. Web development involves both server-side and client-side scripting. If you ignore client-side scripting, you're only doing half the job!
If you need help with the JavaScript portions, post a question in the JavaScript/DHTML forum.
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
Any ASP.NET code executes on the server. So yes, you can print something, but it will print to your web server's default printer, if there is one. I assume you want to let the user print something from their browser. You need client-side code to that.
Once more, it's "JavaScript" - Java is a completely different animal. If you ask questions about "Java", you'll get answers about "Java", which won't be relevant.
I'd be happy to help you more, but we're off-topic. You should post a new question in the JavaScript/DHTML forum.
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
Regarding ASP.NET Web Server Controls. They GENERATE html code.
So, an ASP.NET Web Server Button Control, creates an element.
What is different about the Web Server Button Control, is that it has server-side events, properties, and methods.
So in Visual Studio.NET, you drag a button control over onto your form. Double-click it, and a code window appears. Any code you enter there will run ON THE SERVER.
What happens is, the user browses to the page, and IIS/ASP.NET renders a page for the user. The user sees a button, and clicks it. That particular click is a client-side event, and unless you code some JavaScript, nothing in particular happens. The form does submit, however, and that's where ASP.NET does a lot of house-keeping to remember that is has a "BUTTON", and that the BUTTON was clicked, and it must run the code you authored.
But none of that helps you with your problem, because printing is a client-side affair.
Really, in your scenario, you don't NEED a WebServer Button Control. A normal html button element, will work just fine:
<input type="button" onclick="window.print();" />
That is the basis of your solution.
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37