postback issues-asp.net 3.5
mainpage.aspx:
this page has 'test page' (asp:hyperlink) which when clicked by user opens the modal popup window 'test.aspx' and it uses following function to open the popup:
function popup(){
var openWindow = window.showModalDialog('test.aspx?pg=1&a=2', '','dialogHeight:375px;dialogWidth:900px;dialogLef t:250;dialogTop:275;center:yes');
}
test.aspx popup page: has 2 buttons - submit and cancel and few fields. submit button stores values in session and closes the popup. cancel button confirms before closing the page.
<asp:button id="btnCancel" runat="server" Text="Cancel" CausesValidation="False" OnClientClick="ConfirmandClose();return false;"></asp:button>
<asp:button id="btnSubmit" runat="server" Text="Submit" onclick="btnSubmit_Click"></asp:button>
function ConfirmandClose() {
if (confirm('want to exit the popup page?')) {
window.close();
}
//return false ;
}
issue:
1. submit button does postback which is fine and it stores values in session and then it closes the popup page automatically using the following code.
Response.Write ("<script language='javascript'>window.close();</script>");
Response.End();
the problem is if i click 'test page link' again from mainpage.aspx, it opens this popup page but page load event of testpage.aspx (popup page) is not raised, I thought every time the page shows up, it will call page_load event of the page which is loaded.
what should i do so that when popup page shows up, it executes page_load event? what is preventing the page load, may be i have to use asp:button instead of asp:hyperlink to open the popup page, if it is true then the first time when i open the popup page it goes to page_load but not the next time after closing it?
any solution.
Thanks.
Last edited by rajn; September 23rd, 2009 at 11:11 PM..
|