window.close()在catch块中不起作用,比我在Vb.net中尝试关闭时如何使用它来关闭窗口 [英] window.close() not working in catch block than how i use this to close window in try catch in Vb.net

查看:108
本文介绍了window.close()在catch块中不起作用,比我在Vb.net中尝试关闭时如何使用它来关闭窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在catch块中,我使用消息框.显示消息并单击确定"后,窗口窗体已关闭但无法正常工作.

in catch block i use message box.after showing message and click OK than window form is close but it is not working.

catch ex As Exception
            'MessageBox.Show("Report already Exist!! Fist delete from a Report Page")
            'Session("Id")=gvList.DataKeys(e.RowIndex).Value)
            Dim strJs As String = "<script>alert('Record Deleted Successfully..');</script>"
            If MessageBox.Show("Report already Exist!! Fist delete from a Report Page", "Title", MessageBoxButtons.OKCancel, _
           Nothing, MessageBoxDefaultButton.Button1) = DialogResult.OK Then

window.close()





因此,我想知道如何解决该问题.





So,I want to know how to solve that one.

推荐答案

规则一:在编写基于Web的应用程序时,请不要使用 Messagebox.Show
它显示在服务器上而不是客户端上.当消息框出现在用户看不到的地球另一端的服务器上时,它似乎在开发中起作用,但在生产中却以很大的方式失败,这在很大程度上是由于以下原因:
1)没有收到消息的用户-实际上他什么也没得到.
2)网络托管管理员,他开始热情地恨你...
Rule number one: When you are writing web based applications, do not use Messagebox.Show
It shows on the server not the client. It seems to work in developement, but fails in a very big way in production, when the message box appears on a server on the other side of the planet where the user can''t see it, much to the apoyance of:
1) The user, who doesn''t get the message - in fact he gets nothing.
2) The web host administrator, who begins to hate you with a passion...


这篇关于window.close()在catch块中不起作用,比我在Vb.net中尝试关闭时如何使用它来关闭窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆