400 users using DBSP now!
home -> documentation -> language reference -> asHTML property


Description

This property indicates that the all the characters of a text contained in a dataset field or variable will be converted to the equivalent HTML codes in order to be visualized.


Syntax

<#BLOBFIELD1 asHTML/>

<#VARIABLE1 asHTML/>

or

<#INCLUDE DOC="TextFile1.dbsp" asHTML>

 

Applications

The asHTML property could be used for example, when you have text stored in a blob field and you want that characters like <,>, etc. or line feeds appear in the page exactly as stored in the database.

The asHTML property could also be used in the DBSP tags:

INCLUDE Tag


Code examples

Example 1. The master pieces web gallery.

The following example shows how to use the ASHTML property for building a Web Gallery.

Source code

Examples/AsHTML1.dbsp


ashtml example




  

master pieces web gallery


  

   
   <#dataset alias="opex" queryid="17">
    

<#title/>


   
     
       
      
     
     
       
     
     
       
     
   

        
      

         <#notes ashtml/>
      

         <#shortdescription ashtml/>         
      

         <#description ashtml/>         
      
    
   <#/dataset>
 

content extracted from:  http://www.ibiblio.org/





Test example


Example 2. Including external files.

This example is very similar the previous one, but it uses the INCLUDE tag to load the description from an external file.

Source code

Examples/AsHTML2.dbsp


ashtml example




  

master pieces web gallery


  
  
    

la gioconda


   
     
       
      
     
     
       
     
     
       
     
   

        
      

         portrait of mona lisa (1479-1528), also known as la gioconda, the wife of francesco del giocondo; 1503-06 (150 kb); oil on wood, 77 x 53 cm (30 x 20 7/8 in); musee du louvre, paris 
      

         this figure of a woman, dressed in the florentine fashion of her day and seated in a visionary, mountainous landscape, is a remarkable instance of leonardo's sfumato technique of soft, heavily shaded modeling.          
      

         <#include doc="monalisa.txt" ashtml/>         
      
   
 

content extracted from:  http://www.ibiblio.org/


 



Test example