@Greg OLone On the web, Modal doesn’t mean that it blocks code execution... only that it prevents the user from interacting with other parts of your app.
Now it's more clear.
But I can also describe a similar situation with a modal (web) dialog.
In the beginning of "Shown" event I call "Show" event of a modal dialog, for example "m.show". Then I make a query using Database.SQLSelect and get some values.
After it I close the modal dialog "m.close".
The point is that the modal dialog is shown after the query to a DB is done but not before. So you can see the modal dialog for less than a second.
Is this because of the browser optimization described above? Because I was waiting from the application to show the webdialog in the beginning and closing after all previous lines of code is executed.
Thanks all for answers.