I have this piece of code in a MVC view that works, but it seams like a lot of code to achieve this simple thing. Any way to make it more efficient?
@if (string.IsNullOrEmpty(ViewBag.Name))
{
@:
}
else
{
@:ViewBag.Name
}
@(ViewBag.Name ?? Html.Raw(" "))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With