473,387 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Page_Load not firing 2nd time round?

Hi,

I have Form1.aspx. Form1 uses client side javascript to launch Form2.aspx
when a button is clicked:
window.showModalDialog("Form2.aspx?xxxxx=xxxx") etc.

The first time the Form1 button is clicked the Form2 Page_Load (server side)
is fired.
I close Form2 returning to Form1. Click the button again. This time when
Form2 loads
there is no Page_Load() event.

Why doesn't it fire?

Thanks,
Craig Miles.
Nov 18 '05 #1
1 1229
Found the answer. Had to add the following code in Form2's Page_Load to stop
it caching:
Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")

Regards,
Craig Miles.

"Craig Miles" <kr*********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi,

I have Form1.aspx. Form1 uses client side javascript to launch Form2.aspx
when a button is clicked:
window.showModalDialog("Form2.aspx?xxxxx=xxxx") etc.

The first time the Form1 button is clicked the Form2 Page_Load (server side) is fired.
I close Form2 returning to Form1. Click the button again. This time when
Form2 loads
there is no Page_Load() event.

Why doesn't it fire?

Thanks,
Craig Miles.

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Studio P.M. | last post by:
Dear colleagues, I kindly ask the C# developers community to help me to REALLY understand the Page_Load event, so to REALLY have it under control. Reason for this question is that I cannot...
2
by: Rohan Parkes | last post by:
I'm fairly new to ASP.NET, and am trying out the Online Newsletter Manager project in Wrox's Beginning C#. The pages are supposed to bind various controls (dropdown lists, datagrids) when the pages...
4
by: Seraph | last post by:
Again, I'm rather new here, so if I fail to follow any etiquette, please forgive me and let me know what I've done wrong, but I think this might interest quite a few people. One of my colleaques...
2
by: Shady Azzam | last post by:
I have an aspx page that calls a modal dialog which loads another aspx page, using javascript: self.showModalDialog(\\target.aspx); The first time i open the modal dialog, target.aspx's...
3
by: Steve Wonderful | last post by:
I would like to know how to catch the code after the end of the Page_Load event. I found something not to my expection after the Page_Load. It is when I hit the ENTER key when it post back. It...
6
by: dwclark | last post by:
I am having an issue when I trigger a Response.Redirect, the Page_Load fires on the page where the Response.Redirect was called. From what I've read, this should not happen and the browser should...
1
by: =?Utf-8?B?TWlrZXkgQmFieQ==?= | last post by:
Greetings Hopefully, I can be clear and concise on this one, but I'm confused. I have a page with a ListBox <- ODS <- BusinessObject and a button. The Parameter Source is 'None'. The Default...
4
by: David C | last post by:
I spent the last four hours trying to figure out why Page_Load would execute twice. Even stranger was that everything within if (! IsPostBack){....} executed twice as well. There is no rhyme or...
1
by: Randy | last post by:
I converted a small (one aspx page) solution from VS2005 to VS2008. It was working fine and then all of a sudden, the Page_Load method is not firing. In the Page_Load method I've got some code...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.