Using following css code I can disable vertical scroll bar for whole mvc 4 project view files.
body {
overflow-y: hidden!important;
}
But how to disable vertical scrollbar for specific cshtml view page
Using following css code I can disable vertical scroll bar for whole mvc 4 project view files.
body {
overflow-y: hidden!important;
}
But how to disable vertical scrollbar for specific cshtml view page
you have two main solutons: with CSS, you select one body or div with class selector ( see selector class for more informations), or you use JQUERY/JS
First solution : tou can wrap the razor page with
<div class="hideVerticalScrollbar">
content here
</div>
or directly use this body:
<body class="hideVerticalScrollbar">
content here
</body >
and then use this rule:
.hideVerticalScrollbar{
overflow-y: hidden!important;
}
OR second possibility, you can use jquery/javascript
$("body:has(div.hideVerticalScrollbar)").css( "overflow-y: hidden!important;" );