kelphis Posted September 20, 2006 Posted September 20, 2006 i have an asp.net app with vb.net on the backend. I have a search page that take an input. when the submit button is pressed im querying a database and build a table on the server in html. i am then trying to insert the table into the <DIV> to be viewed by the client but I am having trouble accessing the div tag by its ID and assigning the table html to the innerHTML of the DIV. among the different ways ive tried are as follows: Response.Write("<script>document.getElementById('divtag').innerHTML='" & TableHTML &"'</script>") Response.Write("<script>document.all.divtag.innerHTML='" & TableHTML &"'</script>") Response.Write("<script>divtag.innerHTML='" & TableHTML &"'</script>") none of these have worked? what am i doing wrong? Quote
Gill Bates Posted September 20, 2006 Posted September 20, 2006 It most likely is due to the fact that the div has not actually been rendered yet. But, regardless, why not just turn the div into a server control:<div id="divTable" runat="server"></div>You will then be able to access it directly in VB. Quote
kelphis Posted September 21, 2006 Author Posted September 21, 2006 bill, you are such a genius. I hate it when the answer is simple. I feel like such a dufuss. thanks bro. it works. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.