473,946 Members | 10,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

OOP help (in regards to ASP.NET Membership)

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 MembershipUser. UnlockUser method
will unlock an account (set the aspnet_Membersh ip IsLockedOut back to
0 so on), but I see no way to Set LockUser. Is there nothing built in
to Membership to do this? '
A user responsed 'No, you have to create your own method that will
lock the user. '. I haven't done much inheritance coding... What's
the
best way of doing this? Do I create a new class that inherits from
Membership? Can you please show me a sample code? I would do it by
creating a class ex. ManageUser and add method 'LockUser' but from my
understanding it's better to extend the current Membership class and
add the new method. If you can sort of map out the main class
structure that would be perfect.
Thx
M.

Sep 12 '07 #1
1 1487
If you are using the standard implementation, you can inherit from the
provider you are using (most likely SqlMembershipPr ovider) and simply add
the new lock method. This helps you avoid a complete rewrite from the base
provider.

One thing I do not like about the default provider is you can set up a lock,
but you cannot specify a reason for the lock in the standard tables. There
are probably some reasons that require a higher level of admin to unlock
again.

Write out your provisioning needs before you start coding, as this can bite
you real quick.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************** *************** *************** ****
| Think outside the box!
|
*************** *************** *************** ****
"mazdotnet" <ma*******@gmai l.comwrote in message
news:11******** **************@ w3g2000hsg.goog legroups.com...
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 MembershipUser. UnlockUser method
will unlock an account (set the aspnet_Membersh ip IsLockedOut back to
0 so on), but I see no way to Set LockUser. Is there nothing built in
to Membership to do this? '
A user responsed 'No, you have to create your own method that will
lock the user. '. I haven't done much inheritance coding... What's
the
best way of doing this? Do I create a new class that inherits from
Membership? Can you please show me a sample code? I would do it by
creating a class ex. ManageUser and add method 'LockUser' but from my
understanding it's better to extend the current Membership class and
add the new method. If you can sort of map out the main class
structure that would be perfect.
Thx
M.

Sep 12 '07 #2

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

Similar topics

3
2459
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 run into a snag with the Membership Provider. It seems many of the MembershipUser properties are read-only. This seems, well stupid, IMO.
2
3575
by: John | last post by:
Hi I was working fine with create user wizard and the default membership provider. I have now customised the membership provider as per attached web.config. The create user wizard picks up the custom membership provider fine and removes the security question/answer fields as designated in the custom provider. The problem is that when I try to create a new user in the create user wizard by entering the info and pressing the 'create...
1
1804
by: Amir Ghezelbash | last post by:
Hello all, I need help with sql server which i was wondering if someone can shed some light on my problem The problem: Hello all, I need help with sql server which i was wondering if someone can shed some light on my problem The problem:
5
2054
by: Vishal Gupta | last post by:
Hi This is Vishal this side.I have been trying to create a new sample website using the new Membership Provider Class. Now when I try to a create a new website and then hit on the Website Administrator Tool and then hit on Security I get this error "There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can
4
1527
by: Pony Tsui | last post by:
I was install the starter kits CLUB, and created a CLUB WEB SITE, this application use the MemberInfo table in club.mdf to store the membership'data, but i can not find out where to define or configure the MemberShipProvider relative to the MemberInfo Table, it just define the connectionString in the web.config. thanks. -- Pony Tsui
3
3293
by: ryan.mclean | last post by:
Hello everyone, I am wondering, can the membership provider be changed at runtime? Perhaps the connectionStringName? I would like to use a different database based on the server the site is on. I suppose that a custom provider could be used to accomplish this, is there another way?
3
1825
by: John | last post by:
Hi I have a web service asmx file in a sub folders of site app root folder. With in the web service I am trying to cerate the user as below; <WebMethod()_ Public Function CreateUser(ByVal Username As String, ByVal Password As String, ByVal Email As String, ByRef ErrMsg As String) As Boolean Dim newUser As MembershipUser = Membership.CreateUser(Username, Password,
2
1593
by: Inverse | last post by:
Would it be alright if i contact you here about a question that's been bugging me for some time to do with membership within ASP.NET 2.0, basically what i am trying to do is move away from using the ASPNETDB.MDF and instead using a SQL2000 Database, and so far i have had no luck with doing such a thing... so far I've created the tables in the database using aspnet_regsql.exe and all looks correct! I am using the following connection...
3
1954
by: GaryDean | last post by:
I have serveral applications now running that are using the MembershipProvider classes and they are each using their own security tables in SQL Server 2005 instead of the express databases - they are all work well. Now we have a need to have many different asp.net websites and web services use a single security database because they all share the same user and administrator community. It doesn't seem there will be a problem with all of...
4
222
by: John | last post by:
Hi 1. Is it possible to disable a user without deleting? 2. Is it possible to add user fields to the membership db such as app's on id for a user? Thanks Regards
0
9976
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
11145
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11331
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
10683
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
9881
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7410
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6106
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
4932
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
4529
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.