473,699 Members | 2,150 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASPNet Membership Controls


Hi All

I have a database which has it's own set of tables for users etc

I already successfully use the Login control by handling the Authenticate
event and checking the suitable values against my own DB.

Now I need to use the ChangePassword control but I cannot stop the system
from trying to create a database.

I would implement my own membershipprovi der but that really seems like a
lot of work.

Is there a way customising the ChangePassword control so it calls my code
to check if the change is valid and to actually perform the change?

Many thanks in advance

--
Rory
Jul 15 '08 #1
5 1962
Create a custom membership provider rather than kludging all of the events.
Through a custom provider, you can tailor all of the processes to use your
table structure instead of the one MS provides.

Here are a couple of links:
http://www.devx.com/asp/Article/29256
http://www.15seconds.com/issue/050216.htm
http://msdn.microsoft.com/en-us/library/f1kyba5e.aspx

and one video
http://www.asp.net/Learn/videos/video-189.aspx

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

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************** *************** **************
| Think outside the box! |
*************** *************** **************
"Rory Becker" <ro********@new sgroup.nospamwr ote in message
news:3a******** *************** ***@news.micros oft.com...
>
Hi All

I have a database which has it's own set of tables for users etc

I already successfully use the Login control by handling the Authenticate
event and checking the suitable values against my own DB.

Now I need to use the ChangePassword control but I cannot stop the system
from trying to create a database.

I would implement my own membershipprovi der but that really seems like a
lot of work.

Is there a way customising the ChangePassword control so it calls my code
to check if the change is valid and to actually perform the change?

Many thanks in advance

--
Rory

Jul 15 '08 #2
Thanks for Gregory for the informative inputs on custom membership
providers.

Hi Rory,

If you just want to reuse the ChangePassword control without involving the
membership provider layer, I think you should register the
"ChangingPasswo rd" event and put your own changing code there. Also, make
sure you call "e.Cancel=t rue" in that event so that it code logic won't go
further to the built-in control's code logic( that's why you see it always
create thet default sqlexpress database).

For example:

=============== ========
protected void ChangePassword1 _ChangingPasswo rd(object sender,
LoginCancelEven tArgs e)
{
e.Cancel = true;

//your own password changing code logic here.

Response.Write( "<br/>Old Password: " +
ChangePassword1 .CurrentPasswor d);

Response.Write( "<br/>New Password: " + ChangePassword1 .NewPassword);
}
=============== ======

BTW, it is also possible that you create a custom control which derive from
the ChangePassword control. I have checked the ChangePassword control's
code in reflector, you can simply override the following code which is the
one that control the postback processing logic:

===
protected override bool OnBubbleEvent(o bject source, EventArgs e)
{
..............

==========

You can do your own work such as (call your own function that changing
password ) in this event

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>Date: Tue, 15 Jul 2008 15:40:43 +0000 (UTC)
Message-ID: <3a************ **************@ news.microsoft. com>
From: Rory Becker <ro********@new sgroup.nospam>
Subject: ASPNet Membership Controls
>
Hi All

I have a database which has it's own set of tables for users etc

I already successfully use the Login control by handling the Authenticate
event and checking the suitable values against my own DB.

Now I need to use the ChangePassword control but I cannot stop the system
from trying to create a database.

I would implement my own membershipprovi der but that really seems like a
lot of work.

Is there a way customising the ChangePassword control so it calls my code
to check if the change is valid and to actually perform the change?

Many thanks in advance

--
Rory
>
Jul 16 '08 #3
Hello Cowboy (Gregory A. Beamer),
Create a custom membership provider rather than kludging all of the
events. Through a custom provider, you can tailor all of the processes
to use your table structure instead of the one MS provides.

Here are a couple of links:
http://www.devx.com/asp/Article/29256
http://www.15seconds.com/issue/050216.htm
http://msdn.microsoft.com/en-us/library/f1kyba5e.aspx
and one video
http://www.asp.net/Learn/videos/video-189.aspx
Those are some great links. Thanks very much.

I also found this post "http://davidhayden.com/blog/dave/archive/2007/10/11/CreateCustomMem bershipProvider ASPNETWebsiteSe curity.aspx"
in which David hayden points out that you do not need to implement every
method and can in fact throw NotImplementedE xceptions for all others.

I finally created a Custom MembseshipProvi der as you suggested

The only methods I needed to implement were 'Initialize', 'GetUser', 'ChangePassword '
and 'ValidateUser'.

I also overrode al the properties but supplied only backing fields for these
and initialised all of these to suitable default values.

I reduced the 1200(approx) line file suggested in the video you linked to,
to (approx) 200 lines.

I'm sure I will need to implement more for some of the other controls that
I might want to use later on but this was fantastic.

Thanks very much

--
Rory
Jul 16 '08 #4
Hello Steven Cheng [MSFT],
If you just want to reuse the ChangePassword control without involving
the membership provider layer, I think you should register the
"ChangingPasswo rd" event and put your own changing code there. Also,
make sure you call "e.Cancel=t rue" in that event so that it code logic
won't go further to the built-in control's code logic( that's why you
see it always create thet default sqlexpress database).
Thanks Steven, this makes a great deal of sense.

I have recently discovered (as indicated in my reply to Cowboy) that the
implementation of a MembershipProvi der need not be as complicated as I thought
an so have gone in this direction instead.

I am curious however, from a theoretical standpoint... If I were to take
your suggestion and cancel the further processing within the ChangingPasswor d
event, how then would I get the control to visually react to the success
or failure of my attempt to change the password?

Thanks again for your help

--
Rory
Jul 16 '08 #5
Thanks for your reply Rory,

Yes, per your scenario, since you won't have much time to implement a
complete new membershp provider, simply intercepting the login control's
event and do your own code logic will be better.

For your new question. Yes, since you cancel the event, the built-in
behavior of LoginControl will not continue as normal. However, based on my
understanding, those LoginControl won't do much more for sucessful or
failure result. Therefore, I think you can also add your own code logic to
display the result. For example, put a label to display successful or
failure condition. How do you think?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>Date: Wed, 16 Jul 2008 16:35:59 +0000 (UTC)
Message-ID: <3a************ **************@ news.microsoft. com>
From: Rory Becker <ro********@new sgroup.nospam>
Subject: RE: ASPNet Membership Controls
>
Hello Steven Cheng [MSFT],
>If you just want to reuse the ChangePassword control without involving
the membership provider layer, I think you should register the
"ChangingPassw ord" event and put your own changing code there. Also,
make sure you call "e.Cancel=t rue" in that event so that it code logic
won't go further to the built-in control's code logic( that's why you
see it always create thet default sqlexpress database).

Thanks Steven, this makes a great deal of sense.

I have recently discovered (as indicated in my reply to Cowboy) that the
implementati on of a MembershipProvi der need not be as complicated as I
thought
>an so have gone in this direction instead.

I am curious however, from a theoretical standpoint... If I were to take
your suggestion and cancel the further processing within the
ChangingPasswor d
>event, how then would I get the control to visually react to the success
or failure of my attempt to change the password?

Thanks again for your help

--
Rory
>
Jul 17 '08 #6

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

Similar topics

2
1426
by: Arjen | last post by:
Hi, I want to use the aspnet tables (for membership, profiles, roles, etc.) inside my own database. I have succesfully installed these tables. Now I need to tell my application or asp.net 2.0 that it can find these tables inside my database. When I go to "asp.net configuration" it copies a new aspnet database. This is not what I want.
2
1393
by: artificer | last post by:
I want to create an Internet application that will be accessed by several pre-registered companies. All of those companies will be accessing the same database and the same application but each one of them will only access the records that belong to their company. Another complication is that not all user of a company will access all the forms or data of her company. For example let's suppose that the web application is call Web1 and will...
3
7130
by: ad | last post by:
I have create a custom membership provider. The common usage of custom membership is set it as default Membership Provider win web.config, and use login controls with it. How can I use custom membership provider without Login Controls? For example, the name of my custom membership provider MyMembershipProvider. Is the codes below right? MyMembershipProvider myProvider=new MyMembershipProvider();
0
6239
by: Anonieko | last post by:
A lot of times, web hostings for ASPNET 2.0 will offer only MS Access DB for database for basic plan, a question often asked is how can I use the membership services, role, web parts services, etc for this MS Access db. Well, microsoft offers a download sample. Instructions are below. HOW TO USE MS ACCESS DB FOR ASPNET APPLICATION SERVICES ( membership, profile, roles, etc providers)
2
1355
by: Seguros Catatumbo | last post by:
Hi, i have decent experience with asp 3.0 (classic), and downloaded web developer express to see what's the fuzz over it. I have lots of questions, mostly regarding the use of forms and database use. 1) Why should i use the asp:label, asp:textbox, asp:submit instead of plain old html input type="...", form action="..." 2) What's up with all those javascript:__dopostback links when using some controls? Does it mean text browsers and...
4
7227
by: thomas | last post by:
Hello All, How to change the default Membership Provider during the runtime? I know I can reference any provider I want, e.g.: provider = Membership.Providers but the question is how to change the default one, so all those new, cool controls can start using the one I want. I can specify the provider for each of those controls, e.g.:
2
1413
by: brown | last post by:
Is it possible to access the authenticated user data using the Membership and MembershipUser classes from an asp.net 2.0 project that doesn't contain the login controls? For example, one project logs users in with the login controls. Another project in a subfolder (so only accessable by authenticated users) uses methods like Membership.GetUser("john"); Whenever I try this, it just returns a null MembershipUser object. Am I just doing...
16
3884
by: Mich | last post by:
Hi, i'm building an web application for anonymous users. They can take a look in the website, nothing more. In order to perform other actions, the anonymous user must be logged. So i create an aspx page with the CreateUserWizard control. The user can fill his username, password etc .... My problem is: when an user fills everything and clicks on button "create an account", nothing happens (no error, but no user account created). I...
1
1102
by: Sunfire | last post by:
How do you make it so the aspnet.mdf file doesnt get created even though I created a custom provider?
0
8697
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
8622
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,...
1
8930
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
7761
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...
1
6538
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
5878
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
4634
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2013
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.