G
Guest
I am using javascript to open a popup window on a ImageButton click.
My Page_Load contains this code
btnNew.Attributes.Add("onclick","popNew()");
this is my javascript
function popNew()
{
window.showModalDialog("popNew.aspx",
null,"center:yes;resizable:no;dialogHeight:500px;dialogWidth:410px");
}
When I click on the ImageButton btnNew the first time, the Page_Load for
popNew fires. I save the details in the form and I do a
Response.Write("<script type='text/javascript'>window.close()</script>");
From the main form when I click the btnNew button for the 2nd time or more,
the Page_Load for popNew doesnt fire.
I am storing some some data in a hidden asp.net textbox in popNew. I clear
the data just before I do window.close() but when I click the button in the
main form and come to the popup the data in the textbox still exists.
If I use window.Open(), then I do not have this problem but again I am using
modalDialog to refresh the page when the popup is closed. With window.open my
code doesnt wait for the popup to close and the refresh takes place before
it needs to happen.
Is their something I am missing? What would be a solution to this?
My Page_Load contains this code
btnNew.Attributes.Add("onclick","popNew()");
this is my javascript
function popNew()
{
window.showModalDialog("popNew.aspx",
null,"center:yes;resizable:no;dialogHeight:500px;dialogWidth:410px");
}
When I click on the ImageButton btnNew the first time, the Page_Load for
popNew fires. I save the details in the form and I do a
Response.Write("<script type='text/javascript'>window.close()</script>");
From the main form when I click the btnNew button for the 2nd time or more,
the Page_Load for popNew doesnt fire.
I am storing some some data in a hidden asp.net textbox in popNew. I clear
the data just before I do window.close() but when I click the button in the
main form and come to the popup the data in the textbox still exists.
If I use window.Open(), then I do not have this problem but again I am using
modalDialog to refresh the page when the popup is closed. With window.open my
code doesnt wait for the popup to close and the refresh takes place before
it needs to happen.
Is their something I am missing? What would be a solution to this?