Skip to content

An example showing how to generate html dynamically at run-time based on a model using Run-time T4 templates.

Notifications You must be signed in to change notification settings

r-aghaei/HtmlUsingRuntimeT4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generating Html using T4 Run-time Templates

Sometimes you want to create a simple text report to print. In these cases generating html output is really useful. Also sometimes you may need to generate some html content at runtime to include in an email.

As an option to create html templates easlily, to make rendering logic and mixing html tags and data simpler, you can use Run-time Text Templates. This way, you can use the t4 template as a view renderer which accepts a model (your data) and render the output.

Then you can pass data to the html template and render the report simply. If you are going to show it in a form, you can assign the output string to a DocumentText property of a WebBrowser and call its Print method to print the document or ShowPrintPreviewDialog to show print preview dialog:

runtime html generation using t4 runtime templates

About

An example showing how to generate html dynamically at run-time based on a model using Run-time T4 templates.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages