I have a problem I call the function (showpincode()) but the value is not working can you help me. I call it using backend but the value (txtRequestEncrypted.text) did not work
BACKEND C#
 List<Upload> c = new List<Upload>();
                c.Add(b);
                a.UploadCardDetails = c;
                a.ProgramName = null;
                a.IPAddress = "111.222.33.444";
                a.Authentication = "Basic RXFNzdzw==";
                object obj = a;
                string test = JsonConvert.SerializeObject(obj);
                string pkey = "test";
                string psalt = "test1";
                string Result = Utilities.Utilities.test1(test, pkey, psalt);
                txtRequestEncrypted.Text = Result.ToString();
this.Controls.Add(new LiteralControl("<script type='text/javascript'>ShowPINPad();</script>"));
JAVASCRIPT VALIDATION TO ACCESS THE PINCODE
<script type="text/javascript">
        window.addEventListener("message", function (ev) {
           "https://testtest.com.ph/index"
            //event origin of virtual pin pad
            $origin = ev.origin;
            //event source of virtual pin pad
            $source = ev.source;
            //IMPORTANT: CHECK THE ORIGIN OF THE DATA!
            if (ev.origin.indexOf($sourceURL)) {
                if (ev.data.message === "deliverResult") {
                    ev.source.close();
                }
                else if (ev.data.message == "RESEND") {
                    txtResponse
                    try {
                        setTimeout(function () {
   var requestData = $('#<%= txtRequestEncrypted.ClientID %>').val();
                            child.postMessage({ message: "requestResult", encryptedRequestData: requestData}, "*");
                        }, 3000);
                    } catch (e) {
                        //checking the virtual pin pad is closed
                        if (child.closed) {
                            console.log('Error encountered when calling virtual pinpad...');
                            clearTimeout(interval);
                            //do something
                            document.getElementById("txtResponse").value = "CLOSED";
                            document.getElementById("txtResponseEncrypted").value = "";
                            return;
                        }
                    }
                }
        }
        });
THIS IS THE FUNCTION to Show Pinpad
 var child = null;
    function ShowPINPad() {
        var height = 406;
        var width = 450;
        var left = Math.round((screen.width / 2) - (width / 2));
        var top = Math.round((screen.height / 2) - (height / 2));
        var targetURL = "https:test.com.ph/index"
        child = window.open(targetURL, "_blank", "scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,directories=no,copyhistory=no,height=" + height + ",width=" + width + ",left=" + left + ",top=" + top + ";");
        // child.focus();
    }
 
     
    