473,804 Members | 2,261 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Lifecycle question regarding master pages

I've been having a recurring issue with master page authentication. Right
now, I have verification code in the Page_Init event of the master page,
which checks the Page.User object to make sure the Membership object is still
alive. If not, it redirects to the login page. If so, it lets the user see
whatever page they were after. My issue is that it seems sometimes this event
doesn't fire when it's supposed to, and I'll get "object refrence not set to
an instance of an object" errors specifically on the call for the User object.

Anybody know how to fix this problem?
Sep 13 '07 #1
2 1265
the master page is a control on the actual page. this means its oninit
fires when other page controls fire, not necessarily first.

you validation code should probably be in BeginRequest in the
application object.
-- bruce (sqlwork.com)

dsorrell wrote:
I've been having a recurring issue with master page authentication. Right
now, I have verification code in the Page_Init event of the master page,
which checks the Page.User object to make sure the Membership object is still
alive. If not, it redirects to the login page. If so, it lets the user see
whatever page they were after. My issue is that it seems sometimes this event
doesn't fire when it's supposed to, and I'll get "object refrence not set to
an instance of an object" errors specifically on the call for the User object.

Anybody know how to fix this problem?
Sep 13 '07 #2
The problem with that is that there are three different areas that require
different authentication. .. each area has its' own master page checking to
make sure the user object is in the right group to be viewing that part of
the website.

"bruce barker" wrote:
the master page is a control on the actual page. this means its oninit
fires when other page controls fire, not necessarily first.

you validation code should probably be in BeginRequest in the
application object.
-- bruce (sqlwork.com)

dsorrell wrote:
I've been having a recurring issue with master page authentication. Right
now, I have verification code in the Page_Init event of the master page,
which checks the Page.User object to make sure the Membership object is still
alive. If not, it redirects to the login page. If so, it lets the user see
whatever page they were after. My issue is that it seems sometimes this event
doesn't fire when it's supposed to, and I'll get "object refrence not set to
an instance of an object" errors specifically on the call for the User object.

Anybody know how to fix this problem?
Sep 14 '07 #3

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

Similar topics

2
3633
by: John Lau | last post by:
Hi, Is there documentation that talks about the page lifecycle, the lifecycle of controls on the page, and the rendering of inline code, in a single document? Thanks, John
1
1629
by: Sasha | last post by:
Hi all asp.net proffesionals out there, How do you implement master pages in your applications? What libraries do you use and what have been your experience? Sasha
11
1415
by: Homam | last post by:
The ASP.NET model is touted as a clean OO approach to developing web pages, yet sometimes the page lifecycle poses silly obstacles that forces you revert to the Olde ASP 3.0 Ways. Here's a rough outline of an ASPX page: .... a bunch of criteria controls... PagingNav ResultSetDisplay SubmitButton
5
2447
by: Michael Herman \(Parallelspace\) | last post by:
1. What are some compelling solutions for using Master/Content pages with Web Pages? 2. If a content area has a web part zone with web parts, what is the user experience like when "editting" the web part page? Does it take place at the page level? ...or the content area level? 3. Where is the Web Part Manager instantiated? ...in the Master Page? ....Content Page? ...elsewhere?
20
2431
by: Alan Silver | last post by:
Hello, In classic ASP, I used to use two include files on each page, one before and one after the main content, to provide a consistent layout across a web site. That way I could just change the include files to change the layout. When I came to ASP.NET, I used user controls to do a similar thing. I have just been looking at master pages, and it looks like they do the same thing. If so, is there any advantage in using them over the...
1
1875
by: Alan Silver | last post by:
Hello, I am just experimenting with master pages, and am trying to add a content placeholder in the <head> section, so that individual pages can set their own page title and meta tags. The master page looks like this... <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
17
3166
by: Rob R. Ainscough | last post by:
Again another simple concept that appears NOT to be intuitive or I'm just stupid. I've read the WROX book and the example doesn't actually show how the .master page links in the other content pages? Kinda sorta a critical point no? Am I missing something? Rob. P.S. the day I find a book that actually is useful rather than just a
3
5977
by: Rich | last post by:
Hi, I want to use 2 master pages, one for the main part of the site, the other for the admin pages. They are quite similar, with many shared elements. Ideally I would like to have a parent master page, which both of these child master pages are based on, and in turn the final pages are based on one of these child master pages.
0
1098
by: alagan | last post by:
Hai Guys, I'm Mathiyalgan... Working as asp.net developer in a small software concern . I've seen ur Article in the website...4guysfromrolla... It is quite nice... I hav used master pages in my application... and i want to use some validation controls in my content pages.. I 've tried but it causes an Error like Server Error in '/Winfairr' Application....
0
9714
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9594
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10600
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10351
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10096
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5534
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3834
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.