I know this seems pretty basic, and it should be, but I cant find out where I am going wrong. (I hve read other articles with similar titles on SO, and other resources on the we
@Steve Hobbs' answer is probably the best, but some of your other solutions could have worked. For example,
@Html.Label(ViewBag.CurrentPath);
will probably work with an explicit cast, like @Html.Label((string)ViewBag.CurrentPath);
. Also, your reference to currentPath
in @Html.Label(ViewData["CurrentPath"].ToString());
is capitalized, wherein your other code it is not, which is probably why you were getting null reference exceptions.