2012-10-30 32 views
0

我一直在试图在我的mvc3项目中实现DhtmlxScheduler标准版v.3.5。 继教程http://www.dhtmlx.com/blog/?p=639dhtmlxScheduler与mvc 3

本教程是在mvc2我相信,我有一些麻烦后,它。

这是我的查看页面;

@*@Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>";*@ 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" > 
    <head runat="server"> 
    <title>Index</title> 

    <script src="@Url.Content("~/Scripts/dhtmlxscheduler.js")" type="text/javascript"></script> 
    <link href="@Url.Content("~/Scripts/dhtmlxscheduler.css")" rel="stylesheet" type="text/css" /> 

    <style type="text/css"> 
     html, body 
     { 
      height:100%; 
      padding:0px; 
      margin:0px; 
     } 
    </style> 
    <script type="text/javascript"> 
     function init() { 
      scheduler.init("scheduler_here", new Date(2010, 6, 1), "month"); 
     } 
    </script> 
</head> 
<body onload="init()"> 
    <div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%;'> 
     <div class="dhx_cal_navline"> 
      <div class="dhx_cal_prev_button">&nbsp;</div> 
      <div class="dhx_cal_next_button">&nbsp;</div> 
      <div class="dhx_cal_today_button"></div> 
      <div class="dhx_cal_date"></div> 
      <div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div> 
      <div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div> 
      <div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div> 
     </div> 
     <div class="dhx_cal_header"> 
     </div> 
     <div class="dhx_cal_data"> 
     </div> 
    </div> 
</body> 
</html> 

当我运行这个页面了它加载压光机,但它是所有的地方的样式表,所以我加了CSS和他们,我什么也没得到?

+0

你是什么意思?空白页?没有事件?萤火虫控制台上的任何东西? –

回答

0

究竟发生了什么问题?这段代码可以在mvc3中工作,除了你应该在页面顶部添加@ {Layout = null;}。调度程序应占用其容器的整个大小,即div#scheduler_here。 如果您希望调度程序仅占用页面的一部分,则可以设置“scheduler_here”的大小,例如< div id =“scheduler_here”class =“dhx_cal_container”style ='width:960px; margin:0 auto; height: 100%;” > 希望它有帮助。