Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In C#.net 3.5 I am opening a sub-window using JavaScript ShowModelDialog Function as below.

C#
function OpenChildWindow()
   {
       //open a new dialog window
       var sFeatures="dialogHeight: 650px;";
       sFeatures += "dialogWidth: 950px;";
       sFeatures += "dialogHide: 1;";
       sFeatures += "center: yes;";
       //sFeatures += "edge: sunken;";
       sFeatures += "scroll: no;";
       sFeatures += "status: yes;";
       sFeatures += "resizeable: yes;";
       sFeatures += "";
       var url = "LL_ADDRESS.aspx";
       entryWindow=window.showModalDialog (url, "LL_ADDRESS", sFeatures);
   }


The window opens and then I can edit in that.
But if I click on a simple button (say clear sub-window) in the sub-window then instead of clearing the sub-window, another (3rd) window is opening.

I want to avoide the opening of third window.
How do I achive this?

Thanks!!!

Ernest
Posted

1 solution

simply in the modal page(LL_ADDRESS.aspx) put this to the <head>
XML
<BASE target="_self">

Solution Credits: this Link
by the way i cant help pointing out if you had done a simple google search:"postback from window.showModalDialog" the first link that came up wouldve given you the exact answer.
 
Share this answer
 
v2
Comments
ernestmachado 17-Oct-12 2:09am    
Thanks!!!
Got the problem solved.

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