Button click on Web Dialog opens its copy in new window



I have an aspx page which I open using the following code fragment below.
The modal web dialog has 2 buttons and whenever I click any of them, a new
containing my web dialog form is opened prior to getting to OnClick event
of the buttons. The buttons are part of a user control placed on the form.

How can I get rid of the new window being launched?

Private Sub cmdFacet_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdFacet.Click

Dim strScript As String

strScript = "<SCRIPT language='javascript'>" & vbCrLf

strScript += "window.showModalDialog
p=no;status=no;resizable=no');" & vbCrLf

strScript += "</SCRIPT>"

Page.RegisterStartupScript("frmFacetOpen", strScript)

End Sub

Vidar Petursson


Depending on what you are doing...
<base target="_self">
Or place a iframe in the dialog and host the page there

Best Regards
Vidar Petursson
Microsoft Internet Client & Controls MVP

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question