Code behind:

```
protected void Page_Load(object sender, EventArgs e)
{
      Page.ClientScript.RegisterClientScriptBlock(GetType(), "MyKey", "CreateNotificationTree(" + UserId + ")", true);
}

```

.js file:

```
function CreateNotificationTree(UserId)
{
    var data = new kendo.data.HierarchicalDataSource({
        transport: {
            read: {
                url: "../api/notifications/byuserid/" + UserId,
                contentType: "application/json"
            }
        },
        schema: {
            model: {
                children: "notifications"
            }
        }
    });

    $("#treeview").kendoTreeView({
        dataSource: data,
        loadOnDemand: true,
        checkboxes: {
            checkChildren: true
        },
        dataTextField: ["notificationType", "NotificationDesc"]
    });
}

```

Markup (do I need this?):

```
<script type="text/javascript">
            $(document).ready(CreateNotificationTree(UserId));
</script>

```

This is not working. The treeview does not get loaded on the page.