Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

Posted
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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...