473,326 Members | 2,438 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,326 software developers and data experts.

Page_Load not firing first consistently

I have a web application where I have my users log in and it takes them
to default.aspx. On that page, I have 2 user controls. Everything
works fine the first time a person logs in. I have a logout button on
one of the user controls which takes the user back to the login screen.
If the user tries to log in again without closing the browser window,
the Page_Prerender in the user control gets fired before the Page_Load
in default.aspx and because the datagrid on the user control relies on
values set in a dropdownlist box on default.aspx, the code breaks
because nothing is set.

How do I force default.aspx to load first every time? Why are things
loading differently the second time the user logs in? I set
breakpoints through the code to verify this.

Thanks.

Molly J. Fagan
Oklahoma Foundation for Medical Quality

Nov 19 '05 #1
2 1479
Just don't allow them to go back to the login page. Normally once you've
logged into a site/application/service you can log out but not back in again.
--
There is always a way
"mo****@hotmail.com" wrote:
I have a web application where I have my users log in and it takes them
to default.aspx. On that page, I have 2 user controls. Everything
works fine the first time a person logs in. I have a logout button on
one of the user controls which takes the user back to the login screen.
If the user tries to log in again without closing the browser window,
the Page_Prerender in the user control gets fired before the Page_Load
in default.aspx and because the datagrid on the user control relies on
values set in a dropdownlist box on default.aspx, the code breaks
because nothing is set.

How do I force default.aspx to load first every time? Why are things
loading differently the second time the user logs in? I set
breakpoints through the code to verify this.

Thanks.

Molly J. Fagan
Oklahoma Foundation for Medical Quality

Nov 19 '05 #2
I'm sorry but I disagree with your statement. I've seen and used many
web applications that allow you to log out and then log back in again.
In fact, I can't think of one web site that doesn't allow for that
because they're *user-friendly*.

The more I've thought about this problem, the more I'm thinking it's
related to caching.
Molly J. Fagan
Oklahoma Foundation for Medical Quality

Nov 19 '05 #3

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

Similar topics

5
by: Adam Clauss | last post by:
I have a webapp which consists of several different webforms. Basically: (1) view the contents of a database (2) one is to add a new entry (3) confirms the new entry. The third form, upon...
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: Guadala Harry | last post by:
Just wondering what could cause this: I have observed that when first opening an aspx page, the Page_Load event fires as expected. Then I go to other pages in the site. When returning to any page...
2
by: Eric Maia | last post by:
I have a textbox (StartDateTextBox) in a UserControl on my page, that is supposed to have a date entered into it. I have a RequiredFieldValidator that has its ControlToValidate property set to the...
14
by: V. Jenks | last post by:
I'm a little rusty having not touched .NET for 6 months and I can't remember why Page_Load is happening twice in this code: private void Page_Load(object sender, System.EventArgs e) {...
2
by: Dave | last post by:
Hi, this is a follow-up to an earlier question but I really haven't found a definitive answer in my search If I have a Base and Derived webform, I've found that the dervived Page_Load event...
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...
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...
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.