468,510 Members | 1,349 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,510 developers. It's quick & easy.

New window being spawned from dialog page when button clicked on form

i have the following .aspx file defined:
..... other tags here ...
<asp:TableCell><asp:button id="AddButton" Runat="server" Text="Add New Vessel..."</asp:button></asp:TableCell>
..... other tags here ...

i also have the following codebehind class code to set the action of the button on click to run a modal dialog as follows:

Page_Load
..... load code here ...
AddButton.Attributes.Add("onclick", "javascript:window.showModalDialog('AddClicked.asp x');return true;")
..... load code here...

finally the AddClicked.aspx page has another button on it and when the button on that page (dialog window) is clicked, a new window is automatically spawned (giving me a total of 3 windows: 1) the starting window, 2) the dialog window, 3) the spawned window. why is this happening? i don't want the dialog to spawn a new window when the button is clicked; i simply want the dialog page to refresh its contents. any help would be great...
Nov 18 '05 #1
2 1540
another note...if i pull the addclicked.aspx button up in its own browser window (type localhost/app/addclicked.asp in the address bar rather than hosting it in a dialog window), clicking on the button in this case does not spawn another window ... i don't understand at this point what is happening

----- Patrick wrote: -----

i have the following .aspx file defined:
... other tags here ...
<asp:TableCell><asp:button id="AddButton" Runat="server" Text="Add New Vessel..."</asp:button></asp:TableCell>
... other tags here ...

i also have the following codebehind class code to set the action of the button on click to run a modal dialog as follows:

Page_Load
... load code here ...
AddButton.Attributes.Add("onclick", "javascript:window.showModalDialog('AddClicked.asp x');return true;")
... load code here...

finally the AddClicked.aspx page has another button on it and when the button on that page (dialog window) is clicked, a new window is automatically spawned (giving me a total of 3 windows: 1) the starting window, 2) the dialog window, 3) the spawned window. why is this happening? i don't want the dialog to spawn a new window when the button is clicked; i simply want the dialog page to refresh its contents. any help would be great...
Nov 18 '05 #2
You need to use smartNavigation, ie. set smartNavigation to true. Problem
with this is that smartNavigation causes a whole new set of problems, but if
your dialog is simple it should be OK.

Cathie

"Patrick" <an*******@discussions.microsoft.com> wrote in message
news:83**********************************@microsof t.com...
another note...if i pull the addclicked.aspx button up in its own browser window (type localhost/app/addclicked.asp in the address bar rather than
hosting it in a dialog window), clicking on the button in this case does not
spawn another window ... i don't understand at this point what is happening
----- Patrick wrote: -----

i have the following .aspx file defined:
... other tags here ...
<asp:TableCell><asp:button id="AddButton" Runat="server" Text="Add New Vessel..."</asp:button></asp:TableCell> ... other tags here ...

i also have the following codebehind class code to set the action of the button on click to run a modal dialog as follows:
Page_Load
... load code here ...
AddButton.Attributes.Add("onclick", "javascript:window.showModalDialog('AddClicked.asp x');return true;") ... load code here...

finally the AddClicked.aspx page has another button on it and when

the button on that page (dialog window) is clicked, a new window is
automatically spawned (giving me a total of 3 windows: 1) the starting
window, 2) the dialog window, 3) the spawned window. why is this happening?
i don't want the dialog to spawn a new window when the button is clicked; i
simply want the dialog page to refresh its contents. any help would be
great...
Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by SJ | last post: by
4 posts views Thread by DM | last post: by
10 posts views Thread by Guadala Harry | last post: by
reply views Thread by NPC403 | last post: by
3 posts views Thread by gieforce | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.