Postback throwing parameter mismatch error in the browser

Hodkiewicz, Eric T 1 Reputation point
2021-09-17T18:15:16.477+00:00

Original post found here with more details postback-throwing-parameter-mismatch-error-in-the-browser

The issue only occurs when triggering a postback when running the code locally. It is triggered by selecting an item in a radio button list.However when I select one of the options. It triggers the loading animation defined in the onchange, and never reloads the page. In the browsers DevTools Console I get two errors. Here is the stack trace

Looking at the locations in the stack trace this one is String.startsWith (apps.mypurecloud.com)

e = "ContentPlaceHolder1_rblStudentsWith_2",
r = "ContentPlaceHolder1_",
n = 0

function(t, e, n) {
"use strict";
var r, o = n(0), i = n(28).f, a = n(13), c = n(137), u = n(25), s = n(138), f = n(4), l = "".startsWith, p = Math.min, h = s("startsWith");
o({
target: "String",
proto: !0,
forced: !!(f || h || (r = i(String.prototype, "startsWith"),
!r || r.writable)) && !h
}, {
startsWith: function(t) {
var e = String(u(this));
c(t);
var n = a(p(arguments.length > 1 ? arguments1 : void 0, e.length))
, r = String(t);
return l ? l.call(e, r, n) : e.slice(n, n + r.length) === r
}
})
}

With the following item in the stack trace being.

String.prototype.startsWith = function String$startsWith(prefix) {
/// <summary locid="M:J#String.startsWith" />
/// <param name="prefix" type="String"></param>
/// <returns type="Boolean"></returns>
var e = Function._validateParams(arguments, [
{name: "prefix", type: String}
]);
if (e) throw e;
return (this.substr(0, prefix.length) === prefix);
}

The problem arises when _validateParams() is called. At this point

arguments = { "ContentPlaceHolder1_", 0 }

But the expected parameters is { "prefix" } so when it checks the count actual to expected it is

params.length == expectedParams.length

My current theory is that the two files in their currently implemented version are not compatible but I have not found how to change the file versions to correct the issue.

A few additional notes. This error only happens when running the code locally because the String$startsWith(prefix) method when deployed does not validate the parameters. That file when running locally is

// Name: MicrosoftAjax.debug.js
// Assembly: System.Web.Extensions
// Version: 4.0.0.0
// FileVersion: 4.8.4330.0
//-----------------------------------------------------------------------
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------
// MicrosoftAjax.js
// Microsoft AJAX Framework.

but on dev or prod it is not the debug version. This is happening to every postback within my webapp that I have checked.

I have a fair amount of freedom on how to resolve this issue, but I have not found any solutions in my last 3 days of throwing everything I can think of at it.

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,417 questions
{count} votes