简体   繁体   English

Javascript 确认或其他类型的确认

[英]Javascript confirmation or other type of confirmation

Hello I have a c# application that has a button "Submit" and in the code behind i am evaluating some stuff when it is clicked.您好,我有一个 c# 应用程序,它有一个“提交”按钮,在后面的代码中,我正在评估一些东西,当它被点击时。 But now, I have a FileUpload in the same page, the one that comes with the standard "Browse" button which I can not code against (and company rules, can not change it to a regular button).但是现在,我在同一页面中有一个 FileUpload,它带有我无法编码的标准“浏览”按钮(和公司规则,不能将其更改为常规按钮)。

So the thing is that when the "Submit" button is clicked, I still want to evaluate what I need to evaluate but I also want a Javascript or any other type of confirmation that prompts the user if the image file selected in the upload has the same name as the previous one then it should pop up "This image file already exists, do you want to replace it?.所以问题是,当单击“提交”按钮时,我仍然想评估我需要评估的内容,但我还想要一个 Javascript 或任何其他类型的确认提示用户上传中选择的图像文件是否具有与上一个名称相同,则应弹出“此图像文件已存在,您要替换它吗?。

But now, see how I want to use the back end On_Submit(Object o, EventArgs e) and also be able to ask the question IF anf only IF the image chosen has the same name as the previous one.但是现在,看看我想如何使用后端 On_Submit(Object o, EventArgs e) 并且如果选择的图像与前一个图像具有相同的名称,也能够提出问题。

Now, I can check this in the same On_Submit button whether the new file name is the same as the old one but how can I do this?现在,我可以在同一个 On_Submit 按钮中检查新文件名是否与旧文件名相同,但我该怎么做呢? from within the On_Submit event?来自 On_Submit 事件? something like就像是

public void On_Submit(Object o, EventArgs e)
{
  //using pseudo code
   if(oldImagename == newImageName)
          pop message to alert if replacement
          do other stuff here
   else
        do other stuff here
}

Thank you guys感谢你们

You could use Jquery Confirm Alert Prompt您可以使用 Jquery确认警报提示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM