Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to add a form-feed to an asp.net panel?

Tags:

c#

I want to add a form-feed to my panel after each Item that I print so that I can have each Item print on its own page.

Is that even possible to do?

For example I can add a line-break to my panel but not sure how to add a form-feed.

Example:

Panel1.Controls.Add(new LiteralControl("<br />"));

Any help would be appreciated.

Thank you

like image 200
hmakled Avatar asked Nov 02 '22 20:11

hmakled


1 Answers

Use the page-break-after css style:

Panel1.Controls.Add(new LiteralControl("<br style='page-break-after:always;' />"));

And watch for the newer break-after css style to replace it (not well supported yet):

Panel1.Controls.Add(new LiteralControl("<br style='break-after:page;' />"));

Note that these apply to a box, so using a <br/> may not be the best choice. An <hr/> might work better.

like image 160
Joel Coehoorn Avatar answered Nov 15 '22 04:11

Joel Coehoorn