0

我一直在尝试在我的 mvc3 项目中实现 DhtmlxScheduler Standard Edition v.3.5。按照http://www.dhtmlx.com/blog/?p=639上的教程进行操作

我相信该教程在 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,但我什么也没得到?

4

1 回答 1

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 %;'> 希望对你有帮助。

于 2012-11-12T10:30:02.580 回答