端口框架4.6到asp.net核心1

时间:2016-09-01 13:49:04

标签: asp.net asp.net-core

我无法构建一些我们已经从fwk 4.6迁移到asp.net核心1的测试项目。 以下是build的输出结果:

   .display
    {
     display:block;
   }

有人知道为什么会出现这个错误吗?

1 个答案:

答案 0 :(得分:0)

我的猜测是你可能必须在你的project.json中包含这个,正如错误消息中所描述的那样

$("#CustomerID").off("click").on("click",function(){
                    if($(this).val()=="0"){
                        projectid = [];     
                    }
                    else{
                        $.ajax({
                            method: "GET",
                            url: "../api/momapi.php?action=getprojectsbycustomerid",
                            data: {"CustomerID":$(this).val()},
                            success: function(data) {
                                console.log(data);
                                projectid = $.parseJSON(data);
                            },
                            error:function( jqXHR, textStatus, errorThrown ){
                                alert( errorThrown );
                            }
                        });
                    }
                });
MomActivity = $("#MomActivity").DataTable({
            "sDom": "t",
            "ajax":{
                "url": "../api/momapi.php?action=getmombyid",
                "type": "GET",
                "data": {"MomID": <?php echo $_GET["MomID"]; ?>}    
            },
            "destroy": true,
            "ordering": false,
            "columns": [
                        {
                            "title": "Project", "data": "projectid", "render": function(data, type, row){
                                return '<select class="form-control selectProjectID" id="Project_'+a+'" name="ProjectID[]" valueid='+ data +'></select>';
                            }   
                        },
                        {
                            "title": "What", "data": "what", "render": function(data, type, row){
                                return  '<input type="text" class="form-control" name="What[]" value="'+ data +'">';            
                            }
                        },
                        {
                            "title": "Who", "data": "who", "render": function(data, type, row){
                                return  '<select class="form-control selectWho" name="Who[]" id="Who_'+c+'" value="'+ data +'">';           
                            }
                        },
                        {
                            "title": "When", "data": "when", "render": function(data, type, row){
                                return  '<input type="text" class="form-control whendate" name="When[]" value="'+ moment(data).format("DD-MM-YYYY") +'">';          
                            }
                        },
                        {
                            "title": "...", "render": function(data, type, row){
                                return '<input type="button" class="btn btn-default btn-sm remove" value="Remove" name="remove" id="remove">';          
                            }
                        }

            ],
            "drawCallback": function(settings){
                $(".selectProjectID").each(function(){
                        if($(this).find("option").length == 0){
                            $(this).fillSelect(projectid,"projectid","projectname",0,1).val($(this).attr("valueid"));
                        }                   
                })
                $(".selectWho").each(function(){
                        if($(this).find("option").length == 0){
                            $(this).fillSelect(momuserid, "userid", "username", 0,1).val($(this).attr("valueid"));
                        }
                });
            },
            "rowCallback": function( row, data, index ) {
                $('td > input.remove', row).off("click").on("click",function(){
                    MomActivity.row($(this).parents('tr')).remove().draw();
                });
                $('td > input.whendate', row).datetimepicker({ format: "DD-MM-YYYY" });
            },
            "fnCreatedRow": function(nRow, aData, iDisplayIndex, iDisplayIndexFull){
                a = a + 1;
                c = c + 1;
            }           
        });  

if($("#CustomerID").val()=="0"){
                MyNotif.Show("Select customer","warning");
            }
            else{
                var selectedProjectID =$("#MomActivity").find('tr:last-child').find('.selectProjectID').val();
                if(typeof selectedProjectID == 'undefined')
                {
                    selectedProjectID = "";
                    MomActivity.row.add({"projectid":selectedProjectID,"what":"","who":"","when":""}).draw();   
                }
                else if(selectedProjectID == "")
                {
                    MyNotif.Show("Select project","warning");
                }
                else{
                    alert(selectedProjectID);
                    MomActivity.row.add({"projectid":selectedProjectID,"what":"","who":"","when":""}).draw();
                }    
            }

但是如果你的问题包含你的完整project.json会更好。我们现在的信息太少了。