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