I am currently working on a change password popup window. My goal is to send the user's username and newly changed password to the parent window once it has been successfully updated in the popup. I would also like the popup to automatically close after a few seconds. However, I am encountering an issue where I am unable to call the JavaScript function from the .cs file. Below is the code snippet I have tried so far. Can anyone provide guidance on how to solve this problem?
string script = "<script>" + "return updateParent();";
if (!ClientScript.IsStartupScriptRegistered("someKey"))
{
ClientScript.RegisterStartupScript(this.GetType(), "someKey", script);
}
<script type="text/javascript">
function updateParent() {
opener.document.form1.getElementById(Username).value = document.form1.getElementById(Username).value;
opener.document.form1.getElementById(pswrd).value = document.form1.getElementById(new_paswrd).value;
self.close();
return false;
}
</script>