0

In my cshtml file, I have the following model directive

@model Model.Common.CameraPopupModel

How can I set Model.CustomHeight to the max-height property in css

<style>
    .customBootboxWidth {
        width: 1300px;
    }
     .restrictBodyHeight {
         max-height: 420px; /*set Model.Height here instead of hardcoding */
         overflow-y: auto;            
     }
</style>

What would be the best practice to achieve this?

1 Answer 1

3

Like this, assuming the style is in the view:

<style>
    .customBootboxWidth {
        width: 1300px;
    }
    .restrictBodyHeight {
        max-height: @(Model.CustomHeight)px;
        overflow-y: auto;            
    }
</style>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.