1

我正在将 Fullcalendar 集成到我的应用程序中。考虑一个经理界面,他可以在其中选择一名员工,然后查看该员工的日历。现在基本上我在我的视图中使用以下 jquery 代码:

<script type="text/javascript">
   $(document).ready(function() {
       $("#calendar").fullCalendar({
           defaultView: 'agendaWeek',
           isRTL: true,
           axisFormat: 'HH:mm',
           editable: true,
           events: "/Scheduler/CalendarData"
       });
   });  
</script>

现在我想将控制器功能分配给事件以检索经理选择的特定用户:

events: "/Scheduler/CalendarData/<current_user_name>

有没有办法从视图中检索选定的员工用户名(或者更确切地说从控制器将其传递给视图),然后将其传递给绑定事件函数?

我希望我足够清楚...

提前致谢, 伊兰

4

1 回答 1

0

使用 jquery ajax 并调用 web 方法......像这样:

        $.ajax({
  type: "POST",
  url: "Scheduler.aspx/GuardarEvento",
  data: "{'SfechaIni':'" + dt_i + "','SfechaFin':'" + dt_f + "'}",
  contentType: "application/json; charset=utf-8",
  dataType: "json",
  success: function(doc) {
             alert(doc.d);
                         }
     });
于 2010-06-02T16:02:50.350 回答