On my razor view web page, there is a div
element where I dynamically populate data in various ways like lazy loading or looping.
If I do not use a layout, for example:
@{
Layout = "_Layout";
}
Then the div
will adhere to my specified height and display a scrollbar if necessary with overflow: auto
.
However, when I introduce a layout, even an empty one, I find that I am unable to alter the height of the div
, causing it to stretch from the layout to the bottom of the screen without any scrolling capability.
What is preventing me from changing the height?
(the div
where I load data into has id container
)
index.cshtml:
... (Content continued)_Layout.cshtml:
...Empty _Layout.cshtml: (also encountering issues with this layout)
...Generated page (Using the empty layout):
...Visual representation of current output and desired outcome: (Note: Placeholder representing AJAX call results shown within gray box) https://i.sstatic.net/keeKO.png
Generated code after incorporating @section and @style, excluding redundant elements from layouts:
...