Write to a file any type from a webpage

I have a domainrequest(URL) that gives me access denied
I eitherneed a work around for this
or I need to write the error to a file on the server or anywhere

I have googled and tried about everything
please help
Kurt RossAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
Not enough info.  We need details to see what is happening.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Kurt RossAuthor Commented:
var xhr = new XMLHttpRequest();
    if ("withCredentials" in xhr) {
        // XHR for Chrome/Firefox/Opera/Safari.
        try {
            xhr.open('get', url, true);
        }
        catch (err) {
        //this below I just copied here in case to use

            return;
        }
    } else if (typeof XDomainRequest != "undefined") {
        // XDomainRequest for IE.
         xhr = new XDomainRequest();
         try {
             xhr.open('get', url); <-- access denied error only on IE
         }
         catch (err) {
--------------------------------------so here I would like to write out the URL to a file any kind any way

             return;
         }
0
Dave BaldwinFixer of ProblemsCommented:
What you have posted runs only in the browser although XMLHttpRequest() makes a request to a page on the server.  To record errors to a file on the server, you would have to make another request to a page on the server that can save the data to a file for you.
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Kurt RossAuthor Commented:
another page like an .aspx page that would write to a file
0
Dave BaldwinFixer of ProblemsCommented:
Yes.
0
Kurt RossAuthor Commented:
and can I add that to a ascx solution a custom web part?
0
Dave BaldwinFixer of ProblemsCommented:
I have no idea.  Please click on "Request Attention" to get other to look at your question.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.