473,796 Members | 2,645 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.NET 2.0 Membership: How to authenticate a user without login control?

Hi,

I am using ASP.NET 2.0 Membership and I need to authenticate a user without
using login control. Is there any sample code that shows me how to do that?

Thank you,
Max

Jul 13 '07 #1
3 9883
On Jul 13, 10:27 pm, "Max2006" <alanal...@news group.nospamwro te:
Hi,

I am using ASP.NET 2.0 Membership and I need to authenticate a user without
using login control. Is there any sample code that shows me how to do that?

Thank you,
Max
hi,

public void Login_OnClick(o bject sender, EventArgs args)
{
if (Membership.Val idateUser(Usern ameTextbox.Text ,
PasswordTextbox .Text))
FormsAuthentica tion.RedirectFr omLoginPage(Use rnameTextbox.Te xt,
NotPublicCheckB ox.Checked);
else
Msg.Text = "Login failed. Please check your user name and
password and try again.";
}

hope help

nahid
http://nahidulkibria.blogspot.com/
http://www.kaz.com.bd

Jul 13 '07 #2
Hi Max,

Nahid has given you a typical code snippet on how to programmaticall y do
the membership user validation and FormsAuthentica tion Login operations.

Actually, for the FormsAuthentica tion and User validation in ASP.NET 2.0,
it consists of two parts:

1. Use membership API to validate the user's username/password credentials

2. All FormsAuthentica tion API to logon(generate and set authentication
ticket/cookie).

Here are some further articles introducing the model of ASP.NET
formsauthentica tion and membership service and how they work together:

#Explained: Forms Authentication in ASP.NET 2.0
http://msdn2.microsoft.com/en-us/library/aa480476.aspx

#Examining ASP.NET 2.0's Membership, Roles, and Profile - Part 1
http://aspnet.4guysfromrolla.com/articles/120705-1.aspx

If you have any further specific questions on this, please feel free to
post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.



Jul 16 '07 #3
Hi Max,

Have you got any further ideas or does the information in previous messages
help you some? If there is anything else we can help, please feel free to
post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 19 '07 #4

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

Similar topics

0
2063
by: Portman | last post by:
I've used the Membership classes in an ASP.NET 2.0 application to create an application that interfaces with an older SQL Server 2000 database. Everything is working except the following... Like many websites, users can sign up by filling in a form. Because we're interacting with other databases, I eschewed the CreateUserWizard control and wrote my own logic programmatically, making use of the Membership.CreateUser() method. ...
3
7138
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();
1
2606
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 fine. but now I want to valid with code like: MyMembershipProvider myProvider = new MyMembershipProvider(); if (myProvider.ValidateUser("myid", "mypw"))
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...
3
4166
by: jason | last post by:
I've been playing around with new (for 2.0) membershp functionality. I was able to build a simple login form that secures a directory on a project I built locally on my development desktop. However, when I attempt to follow the same steps on the remote test server (a website I access via filesystem security accross my lan ).. I get the following when I attempt to select the security tab from the administer selection of the login...
0
1280
by: chris | last post by:
I've been thinking about adding to my asp.net 2.0 web project (ecommerce) the use of the membership and login control capability. I've read a lot but still don't quite understand the practical use. I've read, since I use Sql Server 2005, that it's better to keep the membership data in local app_data, though you can add it to your existing db. The issue I have is how do I manage the common tasks of a user's area; to display order history,...
4
4735
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 above and beyond what the prodiver currently allows. I need the ability to access a user id and the user's permission id. With Forms authentication in 1.1, I would just create a custom identiy and principal and store the information in the identity....
3
3201
by: =?Utf-8?B?TWFyY0c=?= | last post by:
I have a Server.Transfer in my asp:Login LoggedIn event handler. I am forcing transfer to a specific page since I do not want to use the ReturnURL that is in Request.Params (i.e., the user addressed some particular page and was redirected to the login form and would be returned there.). The control's DestinationUrl is only used if the login page was the original target of the request. In the event handler,...
5
1966
by: Rory Becker | last post by:
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.
0
10461
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
10239
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
10190
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
9057
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
7555
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
6796
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
5579
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4122
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
3
2928
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.