Ask Your Question
2

In cshtml, is it possible to conceal a certain div by incorporating a condition, without employing styles?

asked 2023-06-27 12:27:41 +0000

qstack gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2023-06-27 12:49:01 +0000

lalupa gravatar image

Yes, it is possible to conceal a certain div by incorporating a condition in cshtml without using styles. This can be done using Razor syntax to conditionally render the div or not. For example:

@if (condition) {

Content to be displayed when condition is true
}

This code will only render the div and its content when the condition is true. Otherwise, it will not be displayed on the page.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-06-27 12:27:41 +0000

Seen: 8 times

Last updated: Jun 27 '23