小编set*_*lio的帖子

使用JavaScript捕获文件窗口的关闭

我正在使用infile来要求用户在他们的机器上浏览文件.如果窗口关闭而未选择文件,是否有办法捕获?
例如,如果单击x.

<input type="file" name="data" id="inFile" size="15" style="display:none" onchange="handleFiles(this)"/>
Run Code Online (Sandbox Code Playgroud)

谢谢

javascript filedialog

7
推荐指数
1
解决办法
1万
查看次数

在chrome中删除dojo按钮上的黄色边框

如何删除Google Chrome中显示的按钮上的黄色边框.我试图覆盖样式,但想象一下你是否必须为每个按钮执行此操作.

在此输入图像描述

.dijitReset .dijitStretch .dijitButtonContents{
    outline:none;
}
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

dojo google-chrome

5
推荐指数
1
解决办法
2605
查看次数

浏览并从用户硬盘中选择文件在IE中给出undefined

当我使用我的输入按钮浏览用户计算机上的文件时,它适用于FF,IE9和Chrome.但是当我将文件传递给IE9中的JS函数时,我得到了未定义,而它在FF和Chrome中完美运行.

 <form id="uploadForm" style='display:none;padding:1px;' method="post" enctype="multipart/form-data">
 <input type="file" name="data" id="inFile" size="15" style="display:none" onchange="handleFiles(this.files)"/>


function handleFiles(files){
//doing something with the files
}



 //In IE files is undefined
Run Code Online (Sandbox Code Playgroud)

我也试过用

    dojo.connect(dojo.byId("uploadForm").data, "onchange", function(evt){
        handleFiles(this.files);
    });

<form id="uploadForm" method="post" enctype="multipart/form-data">
<input type="file" name="data" id="inFile" size="15" style="display:none"/>
Run Code Online (Sandbox Code Playgroud)

This.files再次未定义

谢谢

html javascript dojo

2
推荐指数
1
解决办法
6004
查看次数

SQL Server中的表之间的约束,删除一个应该删除另一个

我正在创建两个表RegistrationHeader和RegistrationDetail.我如何添加一个约束,当我删除RegistrationHeader表以自动删除RegistrationDetail表.

create table RegistrationHeader(
    RegistrationNo numeric
    ,BillingID varchar(30) not null
    ,RegistrationDate date not null
    ,PaymentType varchar check (PaymentType = 'CC' or PaymentType = 'PO' or PaymentType = 'Check') not null
    ,CCNumber numeric check(CCNumber >= 15 and CCNumber <=16)
    ,PONumber varchar(30)
    ,CheckNumber varchar(10)
    ,primary key(RegistrationNo)
    ,foreign key(BillingId) references Person(UserID) 
    ,constraint CC_CCNumber_constr check(
        (PaymentType = 'CC' and CCNumber is not null)
        or
        (PaymentType != 'CC' and CCNumber is null)
    )
    ,constraint PO_PONumber_constr check(
        (PaymentType = 'PO' and (PONumber is not null or …
Run Code Online (Sandbox Code Playgroud)

sql sql-server

2
推荐指数
1
解决办法
89
查看次数

缺少 .NET Core 2.0 和 Azure Web 作业 3.0 的 Azure 服务总线触发器配置

我正在做一个项目,我想在 Web 作业中实现 Service Buss 触发器。我已按照此处的说明进行操作:https : //docs.microsoft.com/en-us/azure/app-service/webjobs-sdk-get-started

 public class Functions
    {
        public static void ProcessQueueMessage([QueueTrigger("queue")] string message, ILogger logger)
        {
            logger.LogInformation(message);
        }
    }
Run Code Online (Sandbox Code Playgroud)

但我想使用 ServiceBus 的 Microsoft.Azure.WebJobs.ServiceBusTrigger 而不是存储队列 (QueueTrigger)。在文档中声明使用以下内容:https : //docs.microsoft.com/en-us/azure/app-service/webjobs-sdk-how-to#service-bus-trigger-configuration-version-3x

static void Main()
{
    var builder = new HostBuilder();
    builder.ConfigureWebJobs(b =>
    {
        b.AddAzureStorageCoreServices();
        b.AddServiceBus(sbOptions =>
        {
            sbOptions.MessageHandlerOptions.AutoComplete = true;
            sbOptions.MessageHandlerOptions.MaxConcurrentCalls = 16;
        });
    });
    var host = builder.Build();
    using (host)
    {

        host.Run();
    }
}
Run Code Online (Sandbox Code Playgroud)

但是,问题是 b.AddServiceBus 甚至不可用(我有最新的 Web 作业版本)。因此,当我运行该项目时,出现“未找到工作职能”错误。任何想法或指示?

我确实尝试过:

 public static void ProcessQueueMessage([Microsoft.Azure.WebJobs.ServiceBusTrigger("queue")] string …
Run Code Online (Sandbox Code Playgroud)

azure azureservicebus azure-webjobssdk asp.net-core-2.0

2
推荐指数
1
解决办法
2026
查看次数

将类分配给Html.BeginForm

我正在使用Html.BeginForm但是当试图为它分配一个类时会出现问题.如果我使用第四名的课很好.但如果我尝试另外使用enctype,则会出现错误.这可以:

@using (Html.BeginForm("Edit", "Inventory", FormMethod.Post, new {enctype = "multipart/form-data"}))
Run Code Online (Sandbox Code Playgroud)

但这不是:

@using (Html.BeginForm("Edit", "Inventory", FormMethod.Post, new {enctype = "multipart/form-data"}, new { @class = "listForm" } ))
Run Code Online (Sandbox Code Playgroud)

这不是:

@using (Html.BeginForm("Edit", "Inventory", FormMethod.Post, new { @class = "listForm" },  new {enctype = "multipart/form-data"}))
Run Code Online (Sandbox Code Playgroud)

请任何想法.谢谢

c# asp.net-mvc

1
推荐指数
1
解决办法
992
查看次数

如何从Kendo UI模板获取值

我有这个模板:

var template = kendo.template("<div class='relatedItemRow'>"
                            + "<span id='relatedItemName'>Related Item #: Number #</span>"
                            + "<div  class='relatedItemRowInfo'><span >#: Name #</span>"
                            + "<a data-relatedItemID='#: Value #' class='removeRelatedItem'>"
                            + "<img src= '#: Img #'/</a></div><br class='clear'/></div>");
var data = {
    Name: "" + checkbox.getAttribute('flatName'),
    Number: $('#relatedItemsList').children().length + 1,
    Img: '/Content/images/x_remove.png',
    Value: checkbox.value
};

var result = template(data);
$("#relatedItemsList").append(result);
Run Code Online (Sandbox Code Playgroud)

我可以使用以下方法访问data-relatedItemID:

$('#relatedItemsList').children().eq(i).children().last().attr('data-relatedItemID')
Run Code Online (Sandbox Code Playgroud)

但是,如何进入数据中的数字字段?我想动态地改变那个.我试过了:

$('#relatedItemsList').children().eq(i).children().attr('Number') == 5
Run Code Online (Sandbox Code Playgroud)

但它不起作用.知道怎么做吗?

html javascript jquery telerik kendo-ui

0
推荐指数
1
解决办法
5995
查看次数

带有count和group by的SQL视图

我有桌子Address,Property并且Listing:

Create Table Listing
    ( PropertyID int  -- Property ID as per the Property table
    , AgentID int
    , ListingDate DateTime not null property
    , AskingPrice Decimal(10,2) not null 
    , SaleDate Date
    , SalePrice Decimal(10, 2)  
    , Primary Key (PropertyID, ListingDate)
    , Foreign Key (PropertyID) references Property(PropertyID)
    , Foreign Key (AgentID) references Agent(AgentID) on delete no action on update no action

Create Table Address
    ( AddressID int Primary Key
    , StreetAddress varchar (100)
    , …
Run Code Online (Sandbox Code Playgroud)

sql sql-server

0
推荐指数
1
解决办法
227
查看次数