Dear all,
I can use this code to write a value in parent window control.

StrJScript = "<SCRIPT>parent.document.forms[0].TxtCustomerId.value = '" & ClearSpace(Row.Cells(1).Text.Trim) & "';</SCRIPT>"
        If Not ClientScript.IsClientScriptBlockRegistered("S1") Then
            ClientScript.RegisterClientScriptBlock(Me.GetType(), "S1", StrJScript)
        End If

but, I cannot set iFrame visible to false.
I use this code :

StrJScript = "<SCRIPT>parent.document.form1.iFrmCustomer.visible = False;</SCRIPT>"
        If Not ClientScript.IsClientScriptBlockRegistered("S4") Then
            ClientScript.RegisterClientScriptBlock(Me.GetType(), "S4", StrJScript)
        End If

Raised error like this parent.document.form1.iFrmCustomer is null or not an object

Thanks

Have you tried this: <script> this.close() </script>

Done, I have solved that problem
I use this code :

StrJScript = "<SCRIPT>parent.document.getElementById('iFrmCustomer').style.display = 'none';</SCRIPT>"
  If Not ClientScript.IsClientScriptBlockRegistered("S4") Then
        ClientScript.RegisterClientScriptBlock(Me.GetType(), "S4", StrJScript)
  End If

Thanks Anyway...

The question is not solved yet. Actually "parent.document.getElementById('iFrmCustomer').style.display = 'none'" - this code will only clear the content of the iframe but the iframe window itself is not closing. Still the iframe is visible...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.