<% @ Page language="C#" %> <% @Import Namespace="TemplateEngine" %> <% // Rows to generate int rows = 100; // Create template object Template tpl = new Template(Server.MapPath("simple.tpl")); tpl.setField("SCRIPT_FILE", "simple.aspx"); // Set all the fields named ROWS in the document tpl.setFieldGlobal("ROWS", rows); // Select section for repeating tpl.selectSection("ROW"); for (int i=1; i<=rows; i++) { // Some number int j = (i-1) * 10; // Make odd and even rows different style tpl.setField("TYPE", i%2); // Set fields tpl.setField("FIELD1", i); tpl.setField("FIELD2", 2+j); tpl.setField("FIELD3", 3+j); tpl.setField("FIELD4", 4+j); tpl.setField("FIELD5", 5+j); tpl.setField("FIELD6", 6+j); tpl.setField("FIELD7", 7+j); // Add content tpl.appendSection(); } tpl.deselectSection(); // Get content and print it to browser Response.Write(tpl.getContent()); %>