iframe inner HTML
-
Hi Can any one help me how to grab inner html from iframe using Java Script and use it in server side.i tried in several ways but failed to do so. this is the javascript function i am using function GetMsg() { document.getElementById("HidTemp").innerText =NewsBody_rich.document.body.innerHTML; //document.getElementById("HidTemp").value=NewsBody_rich.document.body.innerHTML; } HidTemp = a HTML Hidden input Type; NewsBody_rich = a iframe run at server; and this is the code in .cs file on page load event. btnSend.Attributes.Add("onClick", "GetMsg();"); btnsend= a asp:button when i click on this button i am getting a error message Sys.WebForms.PageRequestManagerServerException:an unknown error occured while processing request on server.the status code returned from the server was :500 please help me out this problem.
-
Hi Can any one help me how to grab inner html from iframe using Java Script and use it in server side.i tried in several ways but failed to do so. this is the javascript function i am using function GetMsg() { document.getElementById("HidTemp").innerText =NewsBody_rich.document.body.innerHTML; //document.getElementById("HidTemp").value=NewsBody_rich.document.body.innerHTML; } HidTemp = a HTML Hidden input Type; NewsBody_rich = a iframe run at server; and this is the code in .cs file on page load event. btnSend.Attributes.Add("onClick", "GetMsg();"); btnsend= a asp:button when i click on this button i am getting a error message Sys.WebForms.PageRequestManagerServerException:an unknown error occured while processing request on server.the status code returned from the server was :500 please help me out this problem.
TRK@UK wrote:
function GetMsg() { document.getElementById("HidTemp").innerText =NewsBody_rich.document.body.innerHTML; //document.getElementById("HidTemp").value=NewsBody_rich.document.body.innerHTML; }
Why don't you comment the first line and uncomment the commented line ? I don't think that HTML input hidden field is having innerText Property ! :confused: My suggestion is make the HidTemp to runat server. Then you can easily get the value on server side.
TRK@UK wrote:
NewsBody_rich.document.body.innerHTML;
I think this will work only on IE... :confused:
printf("Navaneeth!!") www.w3hearts.com
-
TRK@UK wrote:
function GetMsg() { document.getElementById("HidTemp").innerText =NewsBody_rich.document.body.innerHTML; //document.getElementById("HidTemp").value=NewsBody_rich.document.body.innerHTML; }
Why don't you comment the first line and uncomment the commented line ? I don't think that HTML input hidden field is having innerText Property ! :confused: My suggestion is make the HidTemp to runat server. Then you can easily get the value on server side.
TRK@UK wrote:
NewsBody_rich.document.body.innerHTML;
I think this will work only on IE... :confused:
printf("Navaneeth!!") www.w3hearts.com