Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. iframe inner HTML

iframe inner HTML

Scheduled Pinned Locked Moved ASP.NET
helpjavajavascripthtmlsysadmin
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TRK UK
    wrote on last edited by
    #1

    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.

    N 1 Reply Last reply
    0
    • T TRK UK

      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.

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      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

      T 1 Reply Last reply
      0
      • N N a v a n e e t h

        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

        T Offline
        T Offline
        TRK UK
        wrote on last edited by
        #3

        Hi I tried in both ways even making Hiddenbox to run at server.but i never understand the error which it is giving. thnaks for reply..

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups