Cant get webdialog to be modal

I have a web form that displays a model dialog and the following line after the displaying the modal dialog I go back to a another page but the modal dialog is being displayed on the page that should be going to after the dialog is displayed. I have tried dragging and dropping the dialog onto the form and have tried to declare it as a new object in the code and both do the same thing. I have modal selected as the form type. Any ideas why this might not be doing what is expected? Thanks

You should use the Dismissed event on the dialog to move to the next page. Modal is a style for the dialog & doesn’t behave the same as a desktop dialog.

Hmm, but what if I have a dialog to display different messages and subject to what is being displayed different things happen. Is their any way to make a web dialog truly modal? Thanks

Set a property in your dialog and reference it in the dismissed event to determine next move.

Ah ok, thanks, didn’t think about doing it that way.

Or use AddHandler to direct the event to a different method for each type. Just make sure you call RemoveHandler too!