I want to simply turn on all borders for all my different columns just
during development so I can the cells for visual design purposes only.
Is there an easy way to do this?
Well, based on your question, its appeard that, we know the container column class name
and the Environment
if this is the scenario then there is an easiest way to achieve your expectations.
Retrive Environment Variable:
Firstly, we would check the Environment Variable
by simply following code snippet
var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
Check The Environment:
Now we know the app environment
therefore, we could check it by a simple conditionals
as following
@{
var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
if (env == "Development")
{
}
}
Manipulateb Your DOM:
@{
var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
if (env == "Development")
{
@section Scripts{
<script type="text/javascript">
alert('@env')
$(".col").css({ "border": "Solid red 2px" });
</script>
}
}
}
HTML:
<div class="container">
<div class="row">
<div class="col">Left column</div>
<div class="col">Middle column</div>
<div class="col">Right column</div>
</div>
</div>
Output:

Note: This is the most easy and simplest way to achieve that.Hope you will found it helpful