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

How to use membership without Login Controls

ad
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();
myProvider.ValidateUser(myUserID, myPassWord).
Jan 25 '06 #1
3 7087
Looks fine to me, as long as it returns true or false.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"ad" wrote:
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();
myProvider.ValidateUser(myUserID, myPassWord).

Jan 26 '06 #2
ad
Thank, but it fall:

I have created a custom Membership Provider, and set it as default
membership provider in web.config.

I have also set deny users ="?" in web.config.

When I use a login control with it, it work fine. but now I want to valid
with code like:

MyMembershipProvider myProvider = new MyMembershipProvider();
if (myProvider.ValidateUser("myid", "mypw"))
{
Response.Redirect("~/Home.aspx");
}

The ValidateUser return true, but it can't redierct to home.aspx.

I find the page.user.identity.name is none after ValidateUser, but if I use
login controls, the Page.User.Identity will set to the login id after valid.

How can I do?

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> glsD:3E********************************* *@microsoft.com...
Looks fine to me, as long as it returns true or false.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"ad" wrote:
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();
myProvider.ValidateUser(myUserID, myPassWord).

Jan 26 '06 #3
Ad,
I believe I already responded to this in another post, but here goes:
If you are doing 100% custom authentication, then once you've validated the
username / password you need to create the FormsAuthentication ticket
yourself also. Take a look at the documentation for FormsAuthentication class
- it has all the methods and sample code.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"ad" wrote:
Thank, but it fall:

I have created a custom Membership Provider, and set it as default
membership provider in web.config.

I have also set deny users ="?" in web.config.

When I use a login control with it, it work fine. but now I want to valid
with code like:

MyMembershipProvider myProvider = new MyMembershipProvider();
if (myProvider.ValidateUser("myid", "mypw"))
{
Response.Redirect("~/Home.aspx");
}

The ValidateUser return true, but it can't redierct to home.aspx.

I find the page.user.identity.name is none after ValidateUser, but if I use
login controls, the Page.User.Identity will set to the login id after valid.

How can I do?

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> ¼¶¼g©ó¶l¥ó·s»D:3E*********************** ***********@microsoft.com...
Looks fine to me, as long as it returns true or false.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"ad" wrote:
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();
myProvider.ValidateUser(myUserID, myPassWord).


Jan 27 '06 #4

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

Similar topics

1
by: Roel Korsten | last post by:
Hello, We're about to develop an ASP.NET 2.0 application. We're investigating all the new stuff in ASP.NET 2.0 and how to use it. There are 2 important specs for the app: 1. App has to have...
1
by: ad | last post by:
I have created a custom Membership Provider, and set it as default membership provider in web.config. I have also set deny users ="?" in web.config. When I use a login control with it, it work...
9
by: Paul Keegstra | last post by:
Hi, I am currently working on an asp.net 2.0 web site that is a replacement of a classic asp web site. The current web site uses a Commerce Server 2002 database for storing user information. ...
3
by: Carl M. | last post by:
Okay, I'm 18 hours into this now and am at a loss. What I've done is create an application on my local workstation using VWD Express using the membership/roles provider and SQL Server Express...
0
by: brown | last post by:
We started an asp.net 2.0 web site with the new login controls. It seems like the Membership and MembershipUser functionality is attached to the web site, so all the web pages for the site will...
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: Steven Nagy | last post by:
Hi all, I'm getting across the membership API stuff. However it seems that we would have benefitted from some extra controls for "Manage Users" and "Manage Roles". Is there some additional...
6
by: Jonathan Wood | last post by:
Although this will be a challenge at my level of ASP.NET knowledge, I'm thinking I should implement my own membership provider class. Looking over the methods I must implement, a number of...
3
by: dm3281 | last post by:
Hello -- I need to write an ASP.NET 2.0 application for our clients to use to login and verify file transmissions. Each client will need their own logon, in addition to a way to assign each...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.