473,396 Members | 1,816 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,396 software developers and data experts.

Membership Class Annoyances or am I just ignorant?

Howdy,

My biggest annoyance with the membership class is that i cannot seem to get
to it in my master files. I'd like to setup my master file to check for
whether or not the current user is logged in or not, and if they are not,
send them over to the login page. But I cannot access the membership class
in a master page. I've done some reading up on this and some people have
suggested using a session variable to store a flag to indicate whether or
not the user is logged in. I tried that but it appears the membership class
expires sooner than the session does. Any ideas?

Thanks,

David Lozzi

Jul 23 '07 #1
2 1198
All objects (Membership, Page, etc.) are re-created on every page
load/postback. However, anything you save in the Session object will be
re-created for each request.

If you are saving the logged in status to the session correctly, you should
be able to retrieve it later.

That said, there is probably a better way to do what you are wanting. Have
you looked into the built-in membership features as far as automatically
re-directing unauthenticated users?
"David Lozzi" <dl****@nospam.nospamwrote in message
news:28**********************************@microsof t.com...
Howdy,

My biggest annoyance with the membership class is that i cannot seem to
get to it in my master files. I'd like to setup my master file to check
for whether or not the current user is logged in or not, and if they are
not, send them over to the login page. But I cannot access the membership
class in a master page. I've done some reading up on this and some people
have suggested using a session variable to store a flag to indicate
whether or not the user is logged in. I tried that but it appears the
membership class expires sooner than the session does. Any ideas?

Thanks,

David Lozzi
Jul 23 '07 #2
The System.Web.Security.Membership class is a static class with static
methods. In other words, you can get to it from any point in your code, as
long as the namespace is resolved. However, when you say "I cannot access
the membership class" you are not describing anything that helps diagnose
what problem you're having. What exactly are you doing to "access" the
class, and what is the result/behavior/exception that you are experiencing?

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"David Lozzi" <dl****@nospam.nospamwrote in message
news:28**********************************@microsof t.com...
Howdy,

My biggest annoyance with the membership class is that i cannot seem to
get to it in my master files. I'd like to setup my master file to check
for whether or not the current user is logged in or not, and if they are
not, send them over to the login page. But I cannot access the membership
class in a master page. I've done some reading up on this and some people
have suggested using a session variable to store a flag to indicate
whether or not the user is logged in. I tried that but it appears the
membership class expires sooner than the session does. Any ideas?

Thanks,

David Lozzi

Jul 24 '07 #3

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

Similar topics

3
by: Morgan | last post by:
Sorry for cross post, forgot to include aspnet in orinal... Thanks in advance for any assistance. I'm in the process of implementing custom RoleProvider & Membership Provider objects and have...
1
by: Andy | last post by:
Hi, I was wondering if someone could advise on if the following is possible. I have one website that is available to the public using Forms authentication and the Membership class, it...
4
by: Ron | last post by:
Hi, I have created a custom membership provider that i use to create certain types of user accounts that only require a User Name and Password nothing else this code below works great if i use...
4
by: =?Utf-8?B?Q2hyaXMgQ2Fw?= | last post by:
I have been having some trouble with implementing a custom Membership Provider. We have a custom data store and business logic that pulls user information. I need some level of functionality...
3
by: daokfella | last post by:
I'm just starting to dive into the new membership stuff and wondering if it is possible to customize the default membership architecture in ASP.Net 2.0 to do the following: Instead of UserName...
38
by: flifus | last post by:
Hi all. I'm learning python these days. I'm going to use this thread to post, from time to time, my annoyances with python. I hope someone will clarify things to me where I have misunderstood them....
3
by: Glenn | last post by:
My current classic-ASP site has users, projects, roles and the 2.0 membership looks like a perfect fit, but I'm having trouble finding examples of how to have users that belong to different...
1
by: mazdotnet | last post by:
Hi all, I just found out that ASP.NET membership does not have a method to lock accounts (only Unlock user) See http://forums.asp.net/p/825946/825946.aspx Question was 'I understand that...
2
by: mazdotnet | last post by:
Hi all, I just found out that ASP.NET membership does not have a method to lock accounts (only Unlock user) See http://forums.asp.net/p/825946/825946.aspx Question was 'I understand that the...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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
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...
0
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...

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.