943,936 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Marked Solved
  • Views: 1546
  • ASP RSS
Oct 26th, 2007
0

HTML code as a variable

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
minbor is offline Offline
18 posts
since Oct 2007
Oct 26th, 2007
0

Re: HTML code as a variable

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:
ASP Syntax (Toggle Plain Text)
  1. <% response.write(myHTML) %>

Hoppy
Reputation Points: 53
Solved Threads: 13
Junior Poster
hopalongcassidy is offline Offline
148 posts
since Oct 2007
Oct 27th, 2007
0

Re: HTML code as a variable

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:
ASP Syntax (Toggle Plain Text)
  1. Session("html") = "all your html oogily boogily"
  2.  
  3. 'to pull it, just put it where you need it on your page with <%= Session("html") %>
Last edited by SheSaidImaPregy; Oct 27th, 2007 at 11:19 pm.
Reputation Points: 43
Solved Threads: 68
Veteran Poster
SheSaidImaPregy is offline Offline
1,080 posts
since Sep 2007
Nov 1st, 2007
0

Re: HTML code as a variable

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

Tnanks
Reputation Points: 10
Solved Threads: 0
Newbie Poster
minbor is offline Offline
18 posts
since Oct 2007
Nov 1st, 2007
0

Re: HTML code as a variable

Glad to help.
Reputation Points: 43
Solved Threads: 68
Veteran Poster
SheSaidImaPregy is offline Offline
1,080 posts
since Sep 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: Website problem
Next Thread in ASP Forum Timeline: Is it possible to call text by ID





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC