Hello,

I am new at programming and would like to know is it possible to pass a chunk of html code (more than one line, a whole table, for example) as an asp variable?
I have looked through a lot of tutorials and could not find a clear answer.

Thank you for all feedback in advance.

minbor

Recommended Answers

All 4 Replies

Sure, where would you like the contents of the variable (say myHTML) to come from? It could be read from a file, it could be passed in from the old web page.

Regardless of the source, you can write it out by:

<% response.write(myHTML) %>

Hoppy

You can store it in a session variable, but if it is really large and you have a lot of traffic on a normal basis, stay away from this way. If this is the case, write it to a file, and when it is read again, delete the file unless it is needed yet again. Otherwise, store the information like below:

Session("html") = "all your html oogily boogily"

'to pull it, just put it where you need it on your page with <%= Session("html") %>

Thank you For the answers. The sollution writting it to the file works perfectly.

Tnanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.