solution • C# in Visual Studio
Martin Dubé edited this page Dec 2, 2020
·
12 revisions
@* Inline commented text *@
@*
Block of commented text
*@
One line shorthands
"#= Value ? 'True_String' : 'False_String' #"
@(ViewBag.Value ? "True_String" : "False_String")
Add shorthands as variables within your .cshtml
templates to clean-up the code for easier maintenance.
@{
var templateBrand = "#= Brand ? 'Brand' : '' #";
var templateModel = "#= Model ? 'Model ' : '' #";
}
Add .ToLower
function to your ressource string to print it in lowercase.
@Resources.Template.ResourceManager.GetString(String.ToLower())
.Title()
content will be populating the<thead><tr><th>
table column heading</th></tr></thead>
while the.ClientTemplate()
wraps it's value within the<tbody><tr><td>
table column cell</td><tr></tbody>
.
c.Template(p => {} )
.Title( Resources.Template.HeadingString1 + " " + Resources.Template.HeadingString2 )
.ClientTemplate( "td" )
.HtmlAttributes(new { @class = "my-css-class" });