Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/278.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ms-access/4.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 ASP.NET在确认窗口中有一个文本字段,并使用必需的字段检查_Javascript_C#_Jquery_Asp.net - Fatal编程技术网

Javascript ASP.NET在确认窗口中有一个文本字段,并使用必需的字段检查

Javascript ASP.NET在确认窗口中有一个文本字段,并使用必需的字段检查,javascript,c#,jquery,asp.net,Javascript,C#,Jquery,Asp.net,我在ASP.NET中单击按钮时显示确认窗口,我在C#中执行此操作,如下所示 ScriptManager.RegisterStartupScript(this, typeof(string), "confirm", "ConfirmAccept();", true); function ConfirmAccept() { if (confirm("Do you confirm to add this entry?")) { var clickButton = docume

我在ASP.NET中单击按钮时显示确认窗口,我在C#中执行此操作,如下所示

ScriptManager.RegisterStartupScript(this, typeof(string), "confirm", "ConfirmAccept();", true);
function ConfirmAccept() {
    if (confirm("Do you confirm to add this entry?")) {
        var clickButton = document.getElementById("<%= button_add.ClientID %>");
        clickButton.click();
    }
}
然后在JavaScript中调用confirm函数,如下所示

ScriptManager.RegisterStartupScript(this, typeof(string), "confirm", "ConfirmAccept();", true);
function ConfirmAccept() {
    if (confirm("Do you confirm to add this entry?")) {
        var clickButton = document.getElementById("<%= button_add.ClientID %>");
        clickButton.click();
    }
}
函数confirmacept(){
如果(确认(“您确认添加此条目吗?”)){
var clickButton=document.getElementById(“”);
单击按钮。单击();
}
}

在这里,当我点击按钮并确认框时,当我按下ok时,
按钮中的代码\u add
点击被执行。但是在这里,我想在确认窗口中显示一个文本框,我想在单击确认框上的OK之前输入一个值。单击“确定”按钮时,此字段还应具有所需的字段检查。然后单击“确定”后,我想访问
按钮\u add
单击事件中此字段的值或文本。我该怎么做呢?

我想你需要这个代码。。 如果你不想要这个

我很抱歉。 我的英语水平很低

.aspx