Click here to Skip to main content
15,884,177 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Is there anyway through which i can log events from a .Net Web service directly into the console of a browser. I mean to say the Developer tools console window.
I know how to log into the console from javascript or jquery.
I am using jquery Ajax to call .Net Web Service methods.
This Web method that i have generates PDF file with the HTML content that i provide to and then save that generated pdf file to the clients downloads folder.

What I have tried:

I am using EVOPDF to generate the PDF file with the HTML content from the currently viewed page's
Updated 2-Sep-16 8:27am
Nathan Minier 2-Sep-16 9:57am    
You just need to return a meaningful response from the service endpoint that can be logged locally. There's no other sane way to do that.
Christopher Fernandes 2-Sep-16 10:06am    
Thanks Nathan

1 solution

As Nathan said, no there is not. As you know, your code for your webservice is running on your server and has no access to the browser that the end user might be using to call your webservice. They could even be using a Windows Forms app or something else to call your service so no, there is definitely no way to get at the browser console.

You can and should have logging on the server. Then as Nathan said, return values but then it is up to the client that calls your service as to whether or not they do something with the return values.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900