CodeCharge Studio All ASP PHP Perl ColdFusion Java C#.NET VB.NET

Add Custom HTML to a Page

This example shows how to display custom HTML dynamically using a Label control.

  1. Add a Label control called CustomHTML.
  2. Set the Content property of the Label to HTML.
  3. In the Before Show event of the Label, add the code below:

ASP

Function Page_BeforeShow(Sender)

  CustomHTML.Value="MyData <table><tr><td>Data 1</td><td>Data 2</td></tr></table>"

End Function

PHP

function Page_BeforeShow(& $sender) {
global $CustomHTML;
  
  $CustomHTML->SetValue("MyData <table><tr><td>Data 1</td><td>Data 2</td></tr></table>" );

}

Perl

sub Page_BeforeShow() {
  
  $CustomHTML->SetValue("MyData <table border=1><tr><td>Data 1</td><td>Data 2</td></tr></table>" );

}

ColdFusion

<!---Page_BeforeShow --->

  <CFSET fldCustomHTML="MyData <table border=1><tr><td>Data 1</td><td>Data 2</td></tr></table>">

VB.Net

'Page_BeforeShow 

  CustomHTML.Text = "MyData <table><tr><td>Data 1</td><td>Data 2</td></tr></table>"

C#

//Page_BeforeShow 

  CustomHTML.Text = "MyData <table><tr><td>Data 1</td><td>Data 2</td></tr></table>";

Java

//Page_BeforeShow 

  e.getPage().getControl("CustomHTML").setValue("MyData <table border=1><tr><td>Data 1</td><td>Data 2</td></tr></table>" );

See also:

Before Show event


On-line, printable versions and updates