How to show a message box in an ASP.NET page?

前端 未结 8 648
青春惊慌失措
青春惊慌失措 2020-12-20 01:34

As I was a Windows programmer it was so easy to show a message box on a form.

But on an ASP.NET page I don\'t know how can I show it?

Actually I have some co

8条回答
  •  臣服心动
    2020-12-20 01:53

    You can use the confirm JavaScript function, but that will be limited to OK/Cancel as options. If this is not what you want, you can lean on the VBScript MsgBox client-side function. Bear in mind that doing so will only work with Internet Explorer.

    function PerformDelete(id)
    {
      if(confirm("I am about to delete this record.  Is this ok?"))
      {
        //your code here
      }
    }
    

提交回复
热议问题