adding table to div tab

kelphis

Newcomer
Joined
Oct 4, 2005
Messages
10
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?
 
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:
Code:
<div id="divTable" runat="server"></div>
You will then be able to access it directly in VB.
 
bill,
you are such a genius. I hate it when the answer is simple. I feel like such a dufuss.

thanks bro. it works.
 
Back
Top