Click here to Skip to main content
16,011,805 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
in catch block i use message box.after showing message and click OK than window form is close but it is not working.

XML
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.
Posted
Comments
Herman<T>.Instance 12-Sep-11 6:34am    
what is not working?

1 solution

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...
 
Share this answer
 
Comments
Rohit Sharma706 12-Sep-11 7:56am    
Thanks for reply
Yes sir you are wright this is happen to me.It is working Local server but when I upload than message is not working.
can you tell how can i solve that problem......
OriginalGriff 12-Sep-11 8:38am    
There are a few options:
1) Create a control on your page, and use that to report problems.
2) Create an error report page, and use that - you may annoy the user though if it causes his data to be lost.
3) Look at the Javascript Alert function - you can cause the client to execute it, displaying a box on the client.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900