I was getting error "NullReferenceException:..." at near the @Html.Raw(...

Hear is the code...

Commons.cshtml :

@helper BoxTitle(string CustomButtons)
{
    if (!string.IsNullOrEmpty(CustomButtons))
    {
        @Html.Raw(CustomButtons)
    }
}

view.cshtml :

<div class="box">
    @Commons.BoxTitle("<button class='sub-button'>New</button>")
    <div class="content">

    </div>
</div>

Does anyone have a solution for this problem?

Related posts

Recent Viewed