开发者

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. 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).

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?.

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.

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? from within the On_Submit event? 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


Check JavaScript Confirm

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜