Click here to Skip to main content
15,906,081 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have an issue with Modaldialog,
1. I use 'window.showModalDialog' to open a modaldialog and Save Data,but when I click the button, another modaldialog open(the same as first modaldialog).
2. And in the asp.net page, there are 2 DropDownList Controls ,one of them set
C#
AutoPostBack="True"
property, when I open the modaldialog then select a Item form the DropDownList, also a new ModalDialog popup .
3. I tried to use
JavaScript
window.open
, all is fine .
The ModalDialog can't Refresh ?!
I dont know why,can you help me.
My code:
JavaScript
function addDetails(empno, year, month) {
    var rav=window.showModalDialog("/Pages/Staff_Balance_Details_Add.aspx?empno=" + empno + "&year=" + year + "&month=" + month, '_self', "dialogWidth=600px;dialogHeight=450px;center=yes;scroll=no", 'dependent=yes, menubar=no, toolbar=no,status=no,modal=yes,scroll=no');
Posted

1 solution

Hi,

If there is any postback occuring inside a ModalDialogue then it will open another window of same modaldialoue window.

To Overcome this you have to target the modaldialoue window to itself.You can do this by adding following tag under your head tag in aspx.
<base target="_self"/>

Hope this helps.

Do let me know if you need anymore details.

Best Regards,
Sriman
 
Share this answer
 

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