Link to home
Start Free TrialLog in
Avatar of Altaf Patni
Altaf PatniFlag for India

asked on

Ifram & ASP.net

Hello ,
 I want Ifram texbox and button using ASP.NET....
ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Altaf Patni

ASKER

i am using following code for trying to send a value from iframe to webpage and want to submit automatically  using java script, but getting an following error,
"Uncaught DOMException: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "http://localhost:53182" from accessing a cross-origin frame."

My code is

      function load() {

          alert("hh");
           // get the iframe in my documnet
    var iframe = document.getElementById("myframe");
    // get the window associated with that iframe
    var iWindow = iframe.contentWindow;

    // wait for the window to load before accessing the content
  
        var doc = iframe.contentDocument || iframe.contentWindow.document;

        // find the target in the iframe content
        var target = doc.getElementById("txtLrNo");
        target.innerHTML = "Found It!";
      }

Open in new window