Avatar of HLRosenberger
HLRosenberger
Flag for United States of America asked on

Page_Load

Page_Load gets called when a page is loaded, correct?  I have a case where I see it getting called only on the first load.  Maybe I'm not understanding something, or maybe the page is never totally unloaded.  But, my page is displayed the first time, I get Page_Load event, and then I click the X in the upper right corner to close it.  Now, the second time the page is displayed I do not get the Page_Load event.  Amy ideas what is wrong?  I'm running inside Visual Studio.
Visual Basic.NETASP.NET

Avatar of undefined
Last Comment
HLRosenberger

8/22/2022 - Mon
jafrazee

Page_load is called everytime the page is refreshed,  It is part of the page life cycle.  The page only lives as long as a new request has not happened.
What is making you believe that Page_Load is not happening.
Do you have code that is not executing in the page_load
Put a break point at the start of the page_load.
You will see it stop.
xav056

maybe you have caching enabled
Nasir Razzaq

Do you mean a breakpoint is not hit or do you mean the code in page_load is not run? The break points will only hit if you run the page from the VS.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
HLRosenberger

ASKER
yes.  I have a break point, and I only get the Page_Load event once.  
ASKER CERTIFIED SOLUTION
fernandovitale

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Nasir Razzaq

As I said, the breakpoint will only hit if you run the page from within the visual studio.
HLRosenberger

ASKER
This is my fault.  has to do with Postback.  Thanks for your help.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
HLRosenberger

ASKER
Thanks