473,946 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Membership - adding methods (programming help)

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
2 1882
On Sep 12, 5:18 pm, mazdotnet <maflat...@gmai l.comwrote:
Hi all,

I just found out that ASP.NET membership does not have a method to
lock accounts (only Unlock user)
Seehttp://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.
Hello:
In case you're using Sql server as repository, the best way to achieve
this is to extend SqlMembership, wich is the class that manage users.
Once you add your method to the new class, you shoul add it to your
system.web provider section in
Webconfig file.

<membership defaultProvider ="CustomizedPro vider">
<providers>
<add name="Customize dProvider"
type="MyNamespa ce.MyMembership Provider" connectionStrin gName="ConStr"
applicationName ="AppName" minRequiredPass wordLength="5"
minRequiredNona lphanumericChar acters="0"
requiresQuestio nAndAnswer="fal se" enablePasswordR eset="true"
enablePasswordR etrieval="false "/>
</providers>
</membership>

Best regards
Oscar Acosta

Sep 13 '07 #2
On Sep 13, 5:43 am, Cubaman <oscar.acostamo nte...@googlema il.com>
wrote:
On Sep 12, 5:18 pm, mazdotnet <maflat...@gmai l.comwrote:


Hi all,
I just found out that ASP.NET membership does not have a method to
lock accounts (only Unlock user)
Seehttp://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.

Hello:
In case you're using Sql server as repository, the best way to achieve
this is to extend SqlMembership, wich is the class that manage users.
Once you add your method to the new class, you shoul add it to your
system.web provider section in
Webconfig file.

<membership defaultProvider ="CustomizedPro vider">
<providers>
<add name="Customize dProvider"
type="MyNamespa ce.MyMembership Provider" connectionStrin gName="ConStr"
applicationName ="AppName" minRequiredPass wordLength="5"
minRequiredNona lphanumericChar acters="0"
requiresQuestio nAndAnswer="fal se" enablePasswordR eset="true"
enablePasswordR etrieval="false "/>
</providers>
</membership>

Best regards
Oscar Acosta- Hide quoted text -

- Show quoted text -
Thank you
M.

Sep 14 '07 #3

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

Similar topics

6
1646
by: Jst | last post by:
Do you need programming help? If so, pop along to our new forum and post your questions to our qualified developers. http://forum.elistarcreations.com
5
1504
by: damian birchler | last post by:
Hello there! I'm wondering if it is possible to automatically dynamically add methods to a class instance. For example, if there is a class Foo with one method named add_function and an instance of Foo f - class Foo: add_function(self, name, args): # ...
2
2335
by: manohar.shankar | last post by:
Hi, I have been searching on this topic for quite sometime and didnt get any answer. Is there a way I can extend/add methods/properties to a C# class during runtime. eg., I have class: public class MyClass {
3
1938
by: Gabriele *darkbard* Farina | last post by:
Hi, there is a way to add methods to an object dynamically? I need to do something like this. I remember python allowed this ... class A(object): def do(s, m): print m @staticmethod def init(obj): obj.do = A.do
2
1510
by: newsgroper | last post by:
I have an abstract class with some abstract methods. I created another class that derives from the abstract method. In the derived class I have overridden all the abstract methods. However, I tried to create a method in the class that doesn't exist in the abstract class and I get a compile error that says the method cannot be found in the abstract class. Am I to understand that I cannot add any additional methods to the derived class...
3
1185
by: Kenneth McDonald | last post by:
This is possible with pure Python classes. Just add the method as new attribute of the class. However, that won't work for the builtins. I know that this is somewhat dangerous, and also that I could subclass the builtins, but not being able to do things like ''.length drives me a little nuts. Python is about the only computer language I use, and I think it's certainly the best of the scripting languages, but there are inconsistencies in...
1
1263
by: nrasch | last post by:
I am coding an application in VB.Net 2005 where objects of a custom class are saved/retrieved into/out of a DB. As my application moves into its 2nd version I have to add new methods and properties into my custom class. How does one go about adding new methods and/or properties to a custom class and then updating existing objects of that class w/out breaking everything? Ex: Pull existing object from DB -> Convert to new version of...
9
1392
by: Mike | last post by:
I was messing around with adding methods to a class instance at runtime and saw the usual code one finds online for this. All the examples I saw say, of course, to make sure that for your method that you have 'self' as the first parameter. I got to thinking and thought "I have a lot of arbitrary methods in several utility files that I might like to add to things. How would I do that?" And this is what I came up with: def...
3
4085
by: zslevi | last post by:
Can I access the class attributes from a method added at runtime? (My experience says no.) I experimented with the following code: class myclass(object): myattr = "myattr" instance = myclass() def method(x):
0
10151
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
9977
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
11556
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...
0
11147
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
11332
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,...
1
8245
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
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...
2
4532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3533
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.