HTML code as a variable

Thread Solved

Join Date: Oct 2007
Posts: 13
Reputation: minbor is an unknown quantity at this point 
Solved Threads: 0
minbor minbor is offline Offline
Newbie Poster

HTML code as a variable

 
0
  #1
Oct 26th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 147
Reputation: hopalongcassidy is an unknown quantity at this point 
Solved Threads: 13
hopalongcassidy's Avatar
hopalongcassidy hopalongcassidy is offline Offline
Junior Poster

Re: HTML code as a variable

 
0
  #2
Oct 26th, 2007
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:
  1. <% response.write(myHTML) %>

Hoppy
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: HTML code as a variable

 
0
  #3
Oct 27th, 2007
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:
  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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 13
Reputation: minbor is an unknown quantity at this point 
Solved Threads: 0
minbor minbor is offline Offline
Newbie Poster

Re: HTML code as a variable

 
0
  #4
Nov 1st, 2007
Thank you For the answers. The sollution writting it to the file works perfectly.

Tnanks
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: HTML code as a variable

 
0
  #5
Nov 1st, 2007
Glad to help.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC