i am having problems figuring out how to handle nulls when passing models to partials as well handling null values in models.
In this block:
@section TaskBar{
@Html.Partial("_TaskBar", Model);
}
I get this error: e:\Views\Shared_TaskBar.cshtml(107): error CS1002: ; expected
???
also, having problem with nulls in the partial
I've tried: this.userID = ko.observable("@if(Model.UserID == null){"null"}else{Model.UserID}");
and
this.userID = ko.observable("@(Model.UserID == null)?"null" :Model.UserID");
with ; etc...
So my question is.. my partial will often be passed a null model.. so how to handle the partial method and if null how to handle in the view? thanks!