Reputation: 652
How to use the @page
css in a Asp.net MVC View (.cshtml
). Because when I tried, It shows an error message
the 'page' does not exist in the current context
And the below mentioned is the stylesheet I used in the view
<style type="text/css" media="print">
@page port {size: portrait;}
@page land {size: portrait;}
@page {
size: 85.60mm 53.98mm;
margin-top: 8.65mm;
margin-bottom: 5.33mm;
margin-left: 4.0mm;
margin-right: 4.0mm;
}
</style>
Upvotes: 1
Views: 3384
Reputation: 3717
Razor use '@' as a special character for scripting language, Try with double @@
<style type="text/css" media="print">
@@page port {size: portrait;}
@@page land {size: portrait;}
@@page
{
size: 85.60mm 53.98mm;
margin-top: 8.65mm;
margin-bottom: 5.33mm;
margin-left: 4.0mm;
margin-right: 4.0mm;
}
</style>
Upvotes: 7