how to use @Model.value for Gantt data file?

the Gantt works great. but I want to automatically pull the item descriptions from the database, in this case MVC.

var tasks = {
data: [
{
id: 1, text: @ViewBag.name, start_date: “01-04-2013”, duration: 11,
progress: 0.6, open: true
},
{
id: 2, text: “Task #1”, start_date: “03-04-2013”, duration: 5,
progress: 1, open: true, parent: 1
},

if I try to add @Model or @ViewBag.value ? then the Gantt will not show up at all.

how to make that work?
thanks

Hi,
in this particular example, be sure to put quotes around @ViewBag.name value, otherwise you’ll have a syntax error or undefined reference error on the client:

var tasks = { data: [ { id: 1, text: "@ViewBag.name", start_date: "01-04-2013", duration: 11, progress: 0.6, open: true }, { id: 2, text: "Task #1", start_date: "03-04-2013", duration: 5, progress: 1, open: true, parent: 1 },

YES! that worked, thanks so much!