2012-10-30 33 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%;」 > 希望它有幫助。