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

User problem

Hello,

I am creating a user as follows:

Membership.CreateUser("user", "pass", "us**@domain.com")

I checked the SQL tables and the user is there.

Then I tried to authenticate the user as follows:

Response.Write(FormsAuthentication.Authenticate("u ser",
"pass").ToString)

It allways gives me false.

What am I doing wrong?

Thanks,

Miguel

Dec 11 '06 #1
2 1072
re:
What am I doing wrong?
The FormsAuthentication.Authenticate Method is not the proper tool to use.

The Authenticate method verifies user credentials that are stored in the
credentials section of the application configuration file, not in the Membership database.

If you have created a login form, you can prompt the user for a user name
and password and then call the ValidateUser method to perform the validation.

There's sample code at :
http://msdn2.microsoft.com/en-us/lib...idateuser.aspx

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"shapper" <md*****@gmail.comwrote in message
news:11**********************@n67g2000cwd.googlegr oups.com...
Hello,

I am creating a user as follows:

Membership.CreateUser("user", "pass", "us**@domain.com")

I checked the SQL tables and the user is there.

Then I tried to authenticate the user as follows:

Response.Write(FormsAuthentication.Authenticate("u ser",
"pass").ToString)

It allways gives me false.

What am I doing wrong?

Thanks,

Miguel


Dec 11 '06 #2
Hi,

I tried this:
Response.Write(Membership.ValidateUser("shapper", "27lamps11"))
Response.Write(Me.User.Identity.IsAuthenticated)

Now I get True and False.

So how can I test if a user has login?

Thanks,
Miguel

Juan T. Llibre wrote:
re:
What am I doing wrong?

The FormsAuthentication.Authenticate Method is not the proper tool to use.

The Authenticate method verifies user credentials that are stored in the
credentials section of the application configuration file, not in the Membership database.

If you have created a login form, you can prompt the user for a user name
and password and then call the ValidateUser method to perform the validation.

There's sample code at :
http://msdn2.microsoft.com/en-us/lib...idateuser.aspx

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"shapper" <md*****@gmail.comwrote in message
news:11**********************@n67g2000cwd.googlegr oups.com...
Hello,

I am creating a user as follows:

Membership.CreateUser("user", "pass", "us**@domain.com")

I checked the SQL tables and the user is there.

Then I tried to authenticate the user as follows:

Response.Write(FormsAuthentication.Authenticate("u ser",
"pass").ToString)

It allways gives me false.

What am I doing wrong?

Thanks,

Miguel
Dec 11 '06 #3

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

Similar topics

2
by: Tom Loach | last post by:
Our system administrator set up an NT server group in order to allow our users to login to our application via https to our sql server. The group appears as a User in SQL Server when you look at...
10
by: Sorin Dolha [MCSD .NET] | last post by:
I would like to start a process from C# code as another user. The C# code is executed as the ASPNET user because it relies in a Web Page class, and I would like that the process will run as another...
0
by: Jim | last post by:
I am having some trouble with user controls and would appreciate any input / advice on where to go with this... :) 1. The first problem, and perhaps the root of the others, is that I have...
0
by: Jim | last post by:
I am having some trouble with user controls and would appreciate any input / advice on where to go with this... :) 1. The first problem, and perhaps the root of the others, is that I have...
8
by: Pete Wittig | last post by:
Hello, I am wondering if it is possible to create a networked application with C# that is seen as a windows user. For example, if Bob logged onto windows and then started the application, any...
5
by: Segfahlt | last post by:
I need a little help here please. I have 2 win forms user controls in 2 different projects that I'm hosting in 2 different virtual directories. The controls have been test and operate okay in...
4
by: Tony Johansson | last post by:
Hello! I have one solution file that consist of three project. One project that build the exe file called A One project that build a user control dll. Here we have a class called B One project...
5
by: tony | last post by:
Hello! This is a rather long mail but it's a very interesting one. I hope you read it. I have tried several times to get an answer to this mail but I have not get any answer saying something...
8
by: mark.norgate | last post by:
I've run into a few problems trying to use generics for user controls (classes derived from UserControl). I'm using the Web Application model rather than the Web Site model. The first problem...
6
by: hemant.singh | last post by:
Hi all, I am trying to get a way by which I'll know exactly when user goes out of my site by clicking on close button in browser, So that w/e user click close button in browser, I can send a...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.