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. accessing client side source from server side

accessing client side source from server side

Scheduled Pinned Locked Moved ASP.NET
questionsysadmin
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
    TintinV3ck
    wrote on last edited by
    #1

    Hi, I'm trying to access client side innerhtml code from server side on postback. How do I do it. I've tried putting a div server tag around the code i need, and then saying divContent.innerhtml, but it doesn't work. Any suggestions? Thanx

    Regards, Tintin

    V 1 Reply Last reply
    0
    • T TintinV3ck

      Hi, I'm trying to access client side innerhtml code from server side on postback. How do I do it. I've tried putting a div server tag around the code i need, and then saying divContent.innerhtml, but it doesn't work. Any suggestions? Thanx

      Regards, Tintin

      V Offline
      V Offline
      Vicky Roberts
      wrote on last edited by
      #2

      Hello... You can put a

      and make the

      runat=server and put all your client code in that

      . Eg :-

      Help Out

      In code behind adding this TbMain.InnerText.ToString() You will get the complete table block from the

      i.e

      Help Out

      Let me knw, if you r looking for something else will try to help you out.

      "Walking on water and developing Software on a specification is easy, if both are frozen..."

      T 1 Reply Last reply
      0
      • V Vicky Roberts

        Hello... You can put a

        and make the

        runat=server and put all your client code in that

        . Eg :-

        Help Out

        In code behind adding this TbMain.InnerText.ToString() You will get the complete table block from the

        i.e

        Help Out

        Let me knw, if you r looking for something else will try to help you out.

        "Walking on water and developing Software on a specification is easy, if both are frozen..."

        T Offline
        T Offline
        TintinV3ck
        wrote on last edited by
        #3

        No, .innerhtml doesn't seem to work. I've tried it with a

        no success. However, putting in a hidden server field, and getting the innerhtml from the div in javascript works, BUT I get an "UNKNOWN ERROR" popup-window when trying to set the hid1.value = div's inner html! I tried setting .value = 'test'; WORKS FINE Why is that '''''heres some code'''' var strHTML = ""; strHTML = document.getElementById('<%=divTables.ClientID% ').innerHTML.toString(); alert(strHTML); //just a test document.getElementById('<%=hid1.ClientID%>').value = strHTML.toString(); //then it breaks. but if its a different string, it works please help

        Regards, Tintin

        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