Including functions in _ViewStart.cshtml
The ConvertControllerNameToCssClass function has limited use, in that it is not likely to be used elsewhere and shouldn't be used elsewhere either.


It looks like the function converts a PascalCase input text to dash-separated-words format.
This is actually a quite common text transformation to do.
In some frameworks it's called "slugify",
and I would prefer this shorter name instead of the current very long name.
(Another naming idea: ToCssClass)



You seem to have a bug:
you check if the input is null,
but you don't check if it's empty.
If it's empty, then this line will throw an exception:


    sb.Append(text[0]);





Instead of transforming the input character by character,
it would be much simpler to use a regex.
I don't know the syntax in C#,
I hope this Perl/Bash example might help:


$ perl -pe 's/[A-Z]/-\L$&amp;/g; s/^-//' &lt;&lt;&lt; HelloWorldThere
hello-world-there