function newTask() { createModal().showUrl('New.aspx'); } function editTask(id) { createModal().showUrl('Edit.aspx?id=' + id); } function viewAssignment(e) { console.log("Test"); createModal().setHeight(300).showUrl('Assignment.aspx?id=' + e.value()); } function createModal() { var modal = new DayPilot.Modal(); modal.top = 60; modal.width = 300; modal.opacity = 50; modal.border = "10px solid #d0d0d0"; modal.closed = function () { if (this.result && this.result.refresh) { dp.commandCallBack("refresh", { message: this.result.message }); } else if (this.result && this.result.tasks) { getTasks(); } }; modal.setHeight = function (height) { modal.height = height; return modal; }; modal.height = 200; modal.zIndex = 100; return modal; } function getTasks() { $.post('AjaxTasks.aspx', function (result) { $("#tasks").html(result); }); }