Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Am coming from C#.net, VB.net back ground to ASP.net. I used them for long time; but the current project is in ASP.Net.


I want alternative for ShowDialog. One important feature of showdialog (which I want) was the code following it is not executed until after the dialog box is closed.

Some jquery alternatives for ShowDialog I have found but they don’t stop execution of code following it (until form or dialog is closed).

Any suggestions

What I have tried:

Some jquery alternatives for showdialog I have found but they don’t stop execution of code following it (until form or dialog is closed)
Posted
Updated 19-Feb-21 1:25am
v2

1 solution

You can't, or at least, you can't do that in your VB code, for the same reason that you can't use ShowDialog, MessageBox.Show, or MsgBox (if you are old enough to remember VB6).

All VB code is executed at the Server, never at the client - the only code you can execute at the client is in JavaScript, and that can't be executed until it's all sent to the client browser and rendering of the HTML starts - which doesn't happen until you have finished building the whole page data in your VB code.
Which means that if your VB code did stop and wait for the user to acknowledge a message then the message would never be presented to the user at all!

All you can do is use the JavaScript Alert[^] to prompt the user and execution of the JavaScript code will halt until the user acknowledges it.
 
Share this answer
 

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