0

I am attempting to expand a CMS system we are using ... writing HTML code to create a Button with the onClick event calling a custom JavaScript function defined.

The function that is being called first queries the user with a "confirm()", and if the user clicks OK then it performs a window.location redirect; if the user clicks CANCEL then the method does nothing.

The redirection ultimately happens, however, in BOTH cases an error appears. In the case selecting OK, because of the redirect, the error that is displayed is short-lived (however the error still happens). In the case of selecting the CANCEL button, at the bottom of my page is get the following error: "There was an error with the form. Please contact the administrator or check logs for more info."

I checked all logs I could find and no further details could be found. I turned "customErrors" off and when viewing the actions performed in Chrome's DevTools environment I see the following: "A potentially dangerous Request.Path value was detected from the client (:)"

I have no clue why I am seeing this error ... I am also pasting my button code below. Any suggestions?

P.S. Running Bootstrap v3

function jsDeleteFileID(p_intFileID)
{
  var objAnswer = confirm("Are you sure you want to delete this file?");
  if (objAnswer == true)
  {
    //****************************************
    // Reload Page w/ Parameters
    //****************************************
    location.href='http://www.MyRedactedWebsiteDomain.com/RedactedWebpageName?DFID=' + p_intFileID + '&ReturnURLID=AAA-AAA-AAA-AAA';
  }
  else
  {
    return false;
  }
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.0/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<button type="button"
        data-loading-text="Please wait..."
        data-name="DeleteFile152"
        class="btn submit form-button af-btn-loading btn-normal btn-danger"
        id="dnn111DeleteFile152"
        onClick="jsDeleteFileID(152); return false;"
        <i class="glyphicon glyphicon-trash"></i> Delete
</button>
TekkGuy
  • 107
  • 2
  • 15
  • Possible duplicate of [A potentially dangerous Request.Path value was detected from the client (\*)](https://stackoverflow.com/questions/5967103/a-potentially-dangerous-request-path-value-was-detected-from-the-client) – Megajin Mar 20 '19 at 15:06

1 Answers1

0

After posting the above, I figured out what the problem was. I would like to post my solution here in case anyone else that is programming on DotNetNuke and using DNNSharp Modules has the same issue.

The problem was in the labels listed in the class property. I removed two class labels: "submit", and "form-button". These two classes added some sort of additional processing that ran AFTER my custom java code which caused errors. Since I only want my code to run and nothing else, removing these two class labels stopped that extra code from running, and now my button behaves as expected.

TekkGuy
  • 107
  • 2
  • 15