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
}
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
}