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. User Control

User Control

Scheduled Pinned Locked Moved ASP.NET
javascripthtmlhelp
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.
  • S Offline
    S Offline
    sathyanarayanan_v04
    wrote on last edited by
    #1

    Hi all, I have one "aspx" page and one "usercontrol(ascx)" page.In the usercontrol page i have one HTML table which i use to show data when the usercontrol is loaded.I'm loading the data into the table using a javasript which is registered in the page load of the usercontrol. In the javascript i'm now referring the Html table as "document.all(""html_cart"").insertRow();" But when the javascript is executed i'm getting the error "document.all().insertrow(); is null or not an object" I even tried with "document.form[0].Usercontrolname_html_cart.insertRow();" where Usercontrolname is the name for the usercontrol page.I used this "Usercontrolname1_html_cart", bcoz in the viewsource i saw that the usercontrol is referred as Usrcontrolname1. Please any one suggest the correct method to refer the html table in the javascript, so that i can add rows and data into the rows Thank you in advance Regards, Sathya

    C 1 Reply Last reply
    0
    • S sathyanarayanan_v04

      Hi all, I have one "aspx" page and one "usercontrol(ascx)" page.In the usercontrol page i have one HTML table which i use to show data when the usercontrol is loaded.I'm loading the data into the table using a javasript which is registered in the page load of the usercontrol. In the javascript i'm now referring the Html table as "document.all(""html_cart"").insertRow();" But when the javascript is executed i'm getting the error "document.all().insertrow(); is null or not an object" I even tried with "document.form[0].Usercontrolname_html_cart.insertRow();" where Usercontrolname is the name for the usercontrol page.I used this "Usercontrolname1_html_cart", bcoz in the viewsource i saw that the usercontrol is referred as Usrcontrolname1. Please any one suggest the correct method to refer the html table in the javascript, so that i can add rows and data into the rows Thank you in advance Regards, Sathya

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You should create a variable and make it's value the ClientID property of the table control. Then you'll always have the client side Id of the table. Assuming it needs to be a server control at all.

      Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      S 1 Reply Last reply
      0
      • C Christian Graus

        You should create a variable and make it's value the ClientID property of the table control. Then you'll always have the client side Id of the table. Assuming it needs to be a server control at all.

        Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        S Offline
        S Offline
        sathyanarayanan_v04
        wrote on last edited by
        #3

        Hi Graus, Thanks for the immediate reply Grauss. In the view source i found the name which aspx page refers to the usercontrol .So i hardcoded the name in the referring session "document.forms[0].Usercontrolname_html_cart.insertRow();" but still its not working. I tried with the alternative " document.all(""html_cart"").insertRow(); Even this is not working. One more thing is that im not dragging and droping the usercontrol in the aspx page . Im using another method to load the usercontrol when the applications starts. Please suggest alternate methods to make it working. with regards Sathyanarayanan

        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