I am using a user control and I need to call a popup, which asks a question, and I need to send the response (true or false) back to the user control that invokes the popup. I declared a hidden field to store the value in it from client-side so I can have access to it from the code behind and then execute further code. I have the following code:
ASP.Net
<script type="text/javascript">
function confirmNoCallList() {
debugger;
var resp = confirm("¿Seguro/a que desea agregar a este subscriptor a la
lista de 'No Llamar'?");
window.opener.document.getElementById('hfAddToNoCallList').value = resp;
}
</script>
<ajax:TabContainer ID="tbcMyProfile" runat="server" ActiveTabIndex="0" Width="500px">
<ajax:TabPanel ID="tbpInfoCta" runat="server" HeaderText="Información de mi
Cuenta">
<ContentTemplate>
<asp:HiddenField ID="hfAddToNoCallList" runat="server" />
.
.
.
I am getting an error when the function hits the window.opener line. Any ideas on how to do this the right way?
You have to get the dynamic
ClientIDat runtime or pass it to a function and an arg that can then find it:or