I actually wrote a little ditty about this...
http://read.allyoushouldknow.com/case-in-point-and-some-gratuitous-ajax-code-to-go/
Back-end for the code is either an ASP or PHP script that generates the table and outputs it in an HTML file, which is read by AJAX and placed inside a DIV in an existing page.
EDIT:
If you're using aspx, you're using .NET, which doesn't need AJAX - instead, there's postback functions built-in; for each aspx file, there should be a .vb file which takes your input and processes it as a regular VB application, and then send the result back to the client.
AJAX runs a server-side request and updates the page *on the client-side*.
Postback and AJAX can be used combined, but I'd advise against it, because you're creating code to create code, and the result is extremely inefficient.
You'll have to make a decision, here: either use AJAX, *or* use aspx/vb postback.
EDIT 2:
If all you're doing is submitting an object to the server using AJAX, and you're not using ASP.Net to do the processing, what you need to do is generate a page that is able to receive and process the XmlHTTPRequest, either by using the POST method (allowing for lots of information to be sent, as if you're sending a form), or GET, which uses a querystring in the form of yourpage.aspx?req=whatever.
The aspx page then takes that information, creates a regular HTML page (or a simple plain text file, or a JSON enabled file), which is received back by the XmlHTTPRequest's onreadystatechange event; when the page has completed loading, the readystate is 4 (complete), with a header number of 200 (HTTP1.1 // page loaded OK). The file - which is invisible to the user using his browser - can then be parsed.
The example on the page I wrote generates a simple, straight-forward HTML table - nothing more, nothing less. The HTML code is then read by my AJAX function as plain text (and parsed as such = as a String); this string is then placed inside the page, into a container DIV that contains the *original* table - because I use the document.getElementById( 'caldiv' ).innerHTML, that original table is then replaced by the newly generated one.
The other methods (which I could have used, but was too lazy to), involve either straight XML, using the page's DOM (Document Object Model), or JSON, which uses a page that generates JavaScript variables and arrays, that can be parsed by the original XmlHTTPRequest.
In the case of XML, I could have chosen to not replace the entire table, but to remove its rows and cells, and recreate them using the table's DOM properties (appendChild, createChild) for each row and subsequent cells.
In the case of JSON, I could have had the code return a string based array of the the table's properties (in this case: name of the month, days of the month, with enough "empty" elements to allow for unused cells at the start and the end)
JSON requires a deep-rooted knowledge of safe scripting, and the ability - in your case - to use one type of scripting language (VBScript) to generate another (JavaScript), including correct syntax and formatting.
XML is the in-between, but you do have to know how to have your code parse XML (drilling down from the root to the lower levels, and assigning each level and node to the corresponding level and node inside your table) - which is a horrific combination of XML DOM and HTML table DOM...
The easiest way by far is to simply render - as I did - a complete table, read its contents, and place those contents one-on-one inside a container. The reason your getElementById didn't work is probably because you don't have the specific DIV id that's used in the code example on my site... :-)
Create your own container element, and use that as the Id.
I would advise, if you're willing to learn, by simply creating a plain text file on your server (call it test.txt), and calling *its* contents using AJAX - that way, you'll always know what it's *supposed* to return.
AJAX isn't hard, but it does take a bit of practice to get it right, using server-side scripting.