Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 用户控制文件isn';t加载到asp.net应用程序中_Javascript_Asp.net_Ajax_Kendo Ui_Ascx - Fatal编程技术网

Javascript 用户控制文件isn';t加载到asp.net应用程序中

Javascript 用户控制文件isn';t加载到asp.net应用程序中,javascript,asp.net,ajax,kendo-ui,ascx,Javascript,Asp.net,Ajax,Kendo Ui,Ascx,我有以下剑道组件的视图: <% Html.Kendo() .TabStrip() .Name("tabstrip") .HtmlAttributes(new { style = "vertical-align:text-top;" }) .Items(tabstrip => { tabstrip.Add()

我有以下剑道组件的视图:

<% Html.Kendo()
       .TabStrip()
       .Name("tabstrip")
       .HtmlAttributes(new { style = "vertical-align:text-top;" })
       .Items(tabstrip =>
       {                           
              tabstrip.Add()
                      .Text("Véhicules en attente")
                      .Selected(true)
                      .Content("<div id='DivVehiculesEnAttente'>  </div>");                          
              tabstrip.Add()
                      .Text("Véhicules repartis")       
                      .Content("<div id='DivVehiculesRepartis'>  </div>");                           

       })
       .Animation(animation =>
       {
                  animation.Enable(true);
                  animation.Open(config =>
                  {
                                 config.Fade(FadeDirection.In);
                                 config.Duration(AnimationDuration.Fast);
                  });
       })
       .Render();
%>
这是我的控制器方法“Get_Vehicleue_enatte”和随它一起启动的方法

public ActionResult Get_Vehicules_EnAttente([DataSourceRequest] DataSourceRequest request, string date)
    {
        try
        {
            List<List<Vehicule>> Data = new List<List<Vehicule>>();

            DateTime dt = Convert.ToDateTime(date);
            Data.Add(Models.Vehicule.Get_Vehicules_EnAttente_ByDate(dt, true));
            return PartialView("VehiculesEnAttente", Data);               
        }
        catch (Exception e)
        {
            WorkflowWCF.Log.enregistrer_erreur(new Exception("Une erreur est survenue lors de la récupération des véhicules planifiés", e));
            return Json(new List<Vehicule>().ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
        }
    }
public ActionResult Get_vehicles_enatte([DataSourceRequest]DataSourceRequest请求,字符串日期)
{
尝试
{
列表数据=新列表();
DateTime dt=转换为ToDateTime(日期);
Data.Add(Models.vehicle.Get_vehicles_enatte_ByDate(dt,true));
返回PartialView(“VehicleSenatte”,数据);
}
捕获(例外e)
{
Workflowcf.Log.Enregister_erreur(新的例外情况(“不存在计划生育率的错误”,e));
返回Json(new List().ToDataSourceResult(request),JsonRequestBehavior.AllowGet);
}
}
我确信以下方法是有效的,因为它适用于以前的版本。

    internal static List<Vehicule> Get_Vehicules_EnAttente_ByDate(DateTime date, bool allowOccurences)
    {
        try
        {
        // Récupération des véhicules avec une planif ET en attente
        List<Models.Vehicule> listeVehicules = new List<Models.Vehicule>();
        List<WorkflowWCF.Vehicule_Quai> liste = My_service.Get_Vehicules_AvecPlanif_ByEtatDate(
            WorkflowWCF.Vehicule.EtatWF.EnAttente, date, date, allowOccurences);

        // Pour chacun de ces véhicules...
        foreach (WorkflowWCF.Vehicule_Quai vQ in liste)
        {
            // Création de l'objet à afficher dans la vue
            Vehicule vPlanifie = ToVueModel(vQ);

            // s'il est de type récurrent 
            if (vQ.IsRecurrent())
            {
                // Le workflow n'a pas encore démarré, ce véhicule n'est pas arrivé.
                vPlanifie.WorkflowID = Guid.Empty;
                // pour retrouver la planification du véhicule récurrent
                vPlanifie.WorkflowID_VehiculePlanifie = vQ.WorkflowID;
            }
            else
            {
                // WorkflowID
                vPlanifie.WorkflowID = vQ.WorkflowID;
                vPlanifie.WorkflowID_VehiculePlanifie = Guid.Empty;
            }

            // Ajout dans le liste
            listeVehicules.Add(vPlanifie);
            // }                
        }
            return listeVehicules;
        }
        catch (Exception ex)
        {
            throw new Exception("Une erreur est survenue dans la fonction Get_Vehicules_EnAttente_ByDate", ex);                
        }

    }
内部静态列表按日期获取车辆启用日期(日期时间日期,布尔允许发生)
{
尝试
{
//在计划和参加会议时,请注意以下事项:
List LISTEVECTIVULES=新列表();
List liste=My\u service.Get\u vehicleus\u AvecPlanif\u byetdate(
工作流程wcf.vehicle.EtatWF.enatte、日期、日期、允许发生次数);
//倒一杯香肠。。。
foreach(列表中的工作流程WCF.Vehicle_Quai vQ)
{
//在法律上的责任
车辆vPlanifie=ToVueModel(vQ);
//这是电流的类型
if(vQ.IsRecurrent())
{
//我们的工作流程是再唱一首歌,而这首歌是在唱一首歌。
vPlanifie.WorkflowID=Guid.Empty;
//倒转为平流
vPlanifie.WorkflowID_VehiclePlannifie=vQ.WorkflowID;
}
其他的
{
//工作流ID
vPlanifie.WorkflowID=vQ.WorkflowID;
vPlanifie.WorkflowID\u VehiclePlanifie=Guid.Empty;
}
//阿约特·丹·勒·李斯特
添加(vPlanifie);
// }                
}
返回李斯特菌群;
}
捕获(例外情况除外)
{
抛出新的异常(“在截止日期之前获得车辆”和“启用日期”),例如;
}
}
最后,这里是我的UserControl文件的代码:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.Collections.Generic.List<System.Collections.Generic.List<IntranetMVC.Models.Vehicule>>>" %>

<script src="<%= Url.Content("~/Scripts/Entrees_Sorties/VehiculesEnAttente.js") %>"type="text/javascript"></script>
<script src="<%= Url.Content("~/Scripts/Entrees_Sorties/Entrees_Sorties.js") %>" type="text/javascript"></script>

<input id="datepicker" />
<script>
     $("#datepicker").kendoDatePicker({
         value: new Date(),
         change: UpdateVehiculesEnAttente
     });    
</script>
<!-- Description : Vue partielle affichant la grille des vehicules attendus sur le site -->
<div class="tabKendo" style="text-align:center" align="center">
     <!-- GRILLES DE DONNES -->

     <% Html.Kendo()
            .Grid<IntranetMVC.Models.Vehicule>()
            .Name("Gd_Today")
            .BindTo(Model[0])
            .Events(e => e
            .Change("OnVehiculeArrive_va"))
            .Columns(columns =>
            {
                     columns.Bound(c => c.sHeurePrevue).Width(100).Title("Heure");
                     columns.Bound(c => c.NomTransporteurPrevu)
                            .Width(200)
                            .ClientTemplate("#= data.NomTransporteur.substring(0,14) #")
                            .Title("Transporteur");                        
            })
            .HtmlAttributes(new { style = "height: 464px; width: 300px; margin:5px; font-size:130%" })
            .Sortable()
            .Selectable(selectable => selectable
                       .Mode(GridSelectionMode.Single))
            .DataSource(dataSource => dataSource
                       .Ajax()
                       .ServerOperation(false)
                       .Sort(sort => sort.Add("sHeurePrevue").Ascending()))
            .Render();                                                        
     %>
</div>

$(“#日期选择器”).kendoDatePicker({
值:新日期(),
更改:更新HiculeSenatent
});    
E
.更改(“车载到达”)
.列(列=>
{
columns.Bound(c=>c.sHeurePrevue).Width(100).Title(“Heure”);
columns.Bound(c=>c.NomTransporteurPrevu)
.宽度(200)
.ClientTemplate(“#=data.NomTransporteur.substring(0,14)#”)
.所有权(“运输人”);
})
.HtmlAttributes(新的{style=“高度:464px;宽度:300px;边距:5px;字体大小:130%”)
.Sortable()
.可选(可选=>可选
.模式(GridSelectionMode.Single))
.DataSource(DataSource=>DataSource
.Ajax()
.ServerOperation(错误)
.Sort(Sort=>Sort.Add(“sHeurePrevue”).Ascending())
.Render();
%>

我无法加载此页面。我的函数是load,我从我的ajax请求中得到消息“updateattente success”。我试图在我的用户控制文件中添加一个console.log(“test”)来测试它是否启动了,但我什么也没有得到
有什么想法吗?

在显示包含内容div的选项卡条时,您的视图如何?这是
onvehicleularrival\u va()
函数中的逻辑吗?如果在激发
updateHiculeSenatette()
之前没有在DOM树中呈现选项卡条的html,您将看不到任何内容,因为div不存在。@Brett视图的其余部分显示正确。单击剑道表中的一个元素时,会调用onvehicleularrival_va()。我在firebug开启的情况下尝试了这个应用,似乎ajax请求中的“retour”是空的。我明白了。确保
entres\u-架次/Get\u-vehicles\u-enatte
是正确的URL,它返回数据。我确信它是正确的URL,因为它在某些更改之前工作。我尝试使用调试器查看控制器方法中的内容。问题是我使用的Telerik组件在IE中是不允许的,Visual不能启动javascript文件,除非在IE中。我将编辑我的帖子并添加我的控制器方法。
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.Collections.Generic.List<System.Collections.Generic.List<IntranetMVC.Models.Vehicule>>>" %>

<script src="<%= Url.Content("~/Scripts/Entrees_Sorties/VehiculesEnAttente.js") %>"type="text/javascript"></script>
<script src="<%= Url.Content("~/Scripts/Entrees_Sorties/Entrees_Sorties.js") %>" type="text/javascript"></script>

<input id="datepicker" />
<script>
     $("#datepicker").kendoDatePicker({
         value: new Date(),
         change: UpdateVehiculesEnAttente
     });    
</script>
<!-- Description : Vue partielle affichant la grille des vehicules attendus sur le site -->
<div class="tabKendo" style="text-align:center" align="center">
     <!-- GRILLES DE DONNES -->

     <% Html.Kendo()
            .Grid<IntranetMVC.Models.Vehicule>()
            .Name("Gd_Today")
            .BindTo(Model[0])
            .Events(e => e
            .Change("OnVehiculeArrive_va"))
            .Columns(columns =>
            {
                     columns.Bound(c => c.sHeurePrevue).Width(100).Title("Heure");
                     columns.Bound(c => c.NomTransporteurPrevu)
                            .Width(200)
                            .ClientTemplate("#= data.NomTransporteur.substring(0,14) #")
                            .Title("Transporteur");                        
            })
            .HtmlAttributes(new { style = "height: 464px; width: 300px; margin:5px; font-size:130%" })
            .Sortable()
            .Selectable(selectable => selectable
                       .Mode(GridSelectionMode.Single))
            .DataSource(dataSource => dataSource
                       .Ajax()
                       .ServerOperation(false)
                       .Sort(sort => sort.Add("sHeurePrevue").Ascending()))
            .Render();                                                        
     %>
</div>