473,785 Members | 2,435 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to use membership provider with login control

ad
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:

MyMembershipPro vider myProvider = new MyMembershipPro vider();
if (myProvider.Val idateUser("myid ", "mypw"))
{
Response.Redire ct("~/Home.aspx");
}

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

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

How can I use Membership Provider without login control?
Jan 26 '06 #1
1 2605
ad,
If you want to do everything programmaticall y, then you need to use this in
conjunction with the FormsAuthentica tion class and methods. once you validate
a user ("true") you need to create a new FormsAuthentica tion ticket and so on.
Suggest you do some reading up in the documentation.

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


"ad" wrote:
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:

MyMembershipPro vider myProvider = new MyMembershipPro vider();
if (myProvider.Val idateUser("myid ", "mypw"))
{
Response.Redire ct("~/Home.aspx");
}

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

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

How can I use Membership Provider without login control?

Jan 26 '06 #2

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

Similar topics

2
11794
by: WB | last post by:
Hi, I am revamping my company's website with ASP.Net 2.0. In order to use our existing user data in our SQL 2000, I have written a custom membership provider. However, when I try to logon with the Login control, it gives an error: System.Data.SqlClient.SqlException: Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'. Is it because I have not run the aspnet_regsql.exe yet? Do I have to?
3
7137
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();
9
2175
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. It does not currently use any of the Commerce Server 2002 functionality with the exception of the user authentication features. I have written my replacement application to use a custom login form and custom connection string so that I can use...
2
1241
by: John | last post by:
OK, I read and read again information on using the logon control, 'custom providers' but none are really helping me out with creating a provider to go against my database to validate the users logging into my web app. What happens when a user logs into my site is, 8 queries are executed, 1 verfies the user, and the others get data pertaining to that users id, so drop downs are populated for that user, etc., So is it possible to use the...
0
1473
by: Jay Pondy | last post by:
I added a Company field to the aspNet_Users table and then followed along with the MSDN docs on How to Implement a Custom Membership User by creating my inherited class from the SqlMembershipProvider and another inherited from MembershipUser to contain the new Company field. In my new Provider class I have overridden the GetUser and CreateUser methods and overloaded the CreateUser to include my new field as per the MSDN article. I have...
0
1445
by: asnowfall | last post by:
After logging in, I am not able to redirect to the target url; and this happens only when I connect to the website using "http://machine- name:portname"; but not if I connect using either "http://IP:portname" or "http://localhost:portname" Web site has custom 'Login control' and custom 'Membership provider'; and I do not have access to 'Login control' control code. MembershipProvider::Validateuser() is returning true irrespective of...
2
2771
by: GaryDean | last post by:
My ASP.Net application, that uses the SQL Membership Provider, runs fine on my development box (server2003) as long as I use the standard provider. But, in anticipation of deployment to other servers I am attempting to register another provider instance. I'm not sure this is the right deployment choice but I haven't found any guidelines on how to best deploy apps using the SQL Membership provider. I first attached...
4
1708
by: alexandis | last post by:
We have tables of logins (users), that differs much from standard microsoft structure - we don't use control question/answer, date fields, etc. But instead we have several additional fields. I expanded membership class and it works for logging in, but going further - creating user - I must make following in CreateUserWizard template: 1) create 'users' record filling standard microsoft fields and ignore those I don't use (mentioned...
1
1032
by: guoyuanliu | last post by:
Hi, I use custom membership provider and custom role provider to manage users of my application. In web.Config I use Form Authentication and define both providers as my default membership and role providers (I have implemented both providers in different class) now.. In Authorization section of web.config, i specifically state only allow roles = A, B . and i also specify for membership provider the name of the application of this web...
0
9645
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
9480
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
10325
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
10147
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
7499
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
6739
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
5381
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
4050
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
3645
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.