Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 23rd, 2009, 09:20 PM
Authorized User
 
Join Date: Nov 2005
Location: , , .
Posts: 15
Thanks: 1
Thanked 0 Times in 0 Posts
Default 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..
 
Old September 24th, 2009, 09:23 AM
Registered User
 
Join Date: Jan 2009
Posts: 3
Thanks: 1
Thanked 1 Time in 1 Post
Default Provide more code

Hello,

Could you please provide a bit more code about the pages. I test your examples and I click the link it will open up the popup an run into Page_Load event of test.aspx! As far as I can see it works as you wish. But it would better to see your code examples.

Greets

tmes
The Following User Says Thank You to tMesi For This Useful Post:
rajn (September 24th, 2009)
 
Old September 24th, 2009, 07:09 PM
Authorized User
 
Join Date: Nov 2005
Location: , , .
Posts: 15
Thanks: 1
Thanked 0 Times in 0 Posts
Default found the issue-caching

Thanks tMesi, found the problem.

Caching is the issue, so added "Response.Cache.SetCacheability(HttpCacheability.No Cache)" in page load which resolved it.

Thanks once again.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Installation Issues - Beginning ASP.Net 2.0 ISBN 0-7645-8850-8 Amyh ASP.NET 2.0 Basics 3 February 5th, 2009 10:06 AM
PostBack Isues in asp.net madhav_srivastava ASP.NET 1.0 and 1.1 Professional 1 December 10th, 2004 01:03 PM
ASP.NET controls performance issues Dmitriy Pro VB 6 0 November 1st, 2004 02:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.