@{
    ViewData["Title"] = "Home Page";
}
<div id="tree">tree here</div>

@section Scripts{
    <script type="text/javascript">
        function getTree() {
            var tree = @Html.Raw(ViewData["treeString"]);
            console.log(tree);
            return tree;
        }

        $('#tree').bstreeview({ data: getTree() });
    </script>
}