Monday, December 12, 2016

Visualforce - Beyond Basics Series 14 - Page not just for tags

What the page can contain ?

In broad sense, visualforce page contains visualforce tags & optionally html, css & javascript. Most developers expect it to contain that standard HTML page contains.

Can it contain other than HTML contents ?

yes. visualforce is not designed to be just the HTML content. It could be following,

  •   PDF
  •   Javascript
  •   CSS
  •   CSV
  •   MS Word

It could be any type that W3 standard supports.

How to achieve that ?

we need to pass the content type attribute to the page tag. Then, it will expect the content to be in that format.


Where is the code ?

For illustration, i have given the page for csv file & javascript. When you load this page, these pages will get downloaded, because, it's not a html page & cannot be loaded.


   

No comments:

Post a Comment

Thanks for reading my blog !