473,326 Members | 2,175 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,326 software developers and data experts.

cannot login with Login control

ad
I use login control of VS2005 in my web application.
The web applicaiton is developed in my notebook.
It run ok in my notebook,
but when I login in from another PC with the user ID and password, it can't
login in.

I tried again and again. When I login with incorrect password, the login
control display the FailureText.
But when I enter the correct password, the Failure Text disappear but it
still stay in the login page.

How can I do?
Jul 10 '06 #1
2 4255
Are you using Forms Authentication? You really haven't provided much
information at all here. Do you want to post some sample code?
Peter

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


"ad" wrote:
I use login control of VS2005 in my web application.
The web applicaiton is developed in my notebook.
It run ok in my notebook,
but when I login in from another PC with the user ID and password, it can't
login in.

I tried again and again. When I login with incorrect password, the login
control display the FailureText.
But when I enter the correct password, the Failure Text disappear but it
still stay in the login page.

How can I do?
Jul 10 '06 #2
ad
Yes, I am using Forms Authentication, I inherrited a MembershipProvider.
My custom MembershipProvider is below

//-------------------Code----------------------------------------------
public class MyMembershipProvider : MembershipProvider
{
private FormsAuthenticationUserCollection _users = null;
private FormsAuthPasswordFormat _passwordFormat;
//private int _MinRequiredNonAlphanumericCharacters = 0;
private int _MinRequiredPasswordLength = 4;
//private int _MaxInvalidPasswordAttempts = 5;
//private int _PasswordAttemptWindow = 5;
#region Not Implemented Members
public override string ApplicationName
{
get
{
throw new Exception("The method or operation is not
implemented.");
}
set
{
throw new Exception("The method or operation is not
implemented.");
}
}
public override bool ChangePasswordQuestionAndAnswer(string
username, string password, string newPasswordQuestion, string
newPasswordAnswer)
{
throw new Exception("The method or operation is not
implemented.");
}

public override MembershipUser CreateUser(string username, string
password, string email, string passwordQuestion, string passwordAnswer, bool
isApproved, object providerUserKey, out MembershipCreateStatus status)
{
throw new Exception("The method or operation is not
implemented.");
}

public override bool DeleteUser(string username, bool
deleteAllRelatedData)
{
throw new Exception("The method or operation is not
implemented.");
}

public override bool EnablePasswordReset
{
get { throw new Exception("The method or operation is not
implemented."); }
}

public override bool EnablePasswordRetrieval
{
get { throw new Exception("The method or operation is not
implemented."); }
}

public override MembershipUserCollection FindUsersByEmail(string
emailToMatch, int pageIndex, int pageSize, out int totalRecords)
{
throw new Exception("The method or operation is not
implemented.");
}

public override MembershipUserCollection FindUsersByName(string
usernameToMatch, int pageIndex, int pageSize, out int totalRecords)
{
throw new Exception("The method or operation is not
implemented.");
}

public override MembershipUserCollection GetAllUsers(int pageIndex,
int pageSize, out int totalRecords)
{
throw new Exception("The method or operation is not
implemented.");
}

public override int GetNumberOfUsersOnline()
{
throw new Exception("The method or operation is not
implemented.");
}

public override string GetPassword(string username, string answer)
{
throw new Exception("The method or operation is not
implemented.");
}
public override MembershipUser GetUser(object providerUserKey, bool
userIsOnline)
{
throw new Exception("The method or operation is not
implemented.");
}

public override string GetUserNameByEmail(string email)
{
throw new Exception("The method or operation is not
implemented.");
}
public override int PasswordAttemptWindow
{
get { throw new Exception("The method or operation is not
implemented."); }
}

public override MembershipPasswordFormat PasswordFormat
{
get { throw new Exception("The method or operation is not
implemented."); }
}

public override string PasswordStrengthRegularExpression
{
get { throw new Exception("The method or operation is not
implemented."); }
}

public override bool RequiresQuestionAndAnswer
{
get { throw new Exception("The method or operation is not
implemented."); }
}

public override bool RequiresUniqueEmail
{
get { throw new Exception("The method or operation is not
implemented."); }
}

public override string ResetPassword(string username, string answer)
{
throw new Exception("The method or operation is not
implemented.");
}

public override bool UnlockUser(string userName)
{
throw new Exception("The method or operation is not
implemented.");
}

public override void UpdateUser(MembershipUser user)
{
throw new Exception("The method or operation is not
implemented.");
}

#endregion

public override int MaxInvalidPasswordAttempts
{
get {
throw new Exception("The method or operation is not
implemented.");
//return _MaxInvalidPasswordAttempts;
}
}

public override int MinRequiredNonAlphanumericCharacters
{
get {
throw new Exception("The method or operation is not
implemented.");
// return _MinRequiredNonAlphanumericCharacters;
}
}

public override int MinRequiredPasswordLength
{
get
{
throw new Exception("The method or operation is not
implemented.");

// return _MinRequiredPasswordLength;
}

}

public override MembershipUser GetUser(string username, bool
userIsOnline)
{
DateTime myDate = DateTime.Today;
MembershipUser user = new MembershipUser(
Name, // Provider name
username, // Username
null, // providerUserKey
"aa@wfs.tan.edu.tw", // Email
String.Empty, // passwordQuestion
"Comment", // Comment
true, // isApproved
false, // isLockedOut
DateTime.Now, // creationDate
DateTime.Now, // lastLoginDate
DateTime.Now, // lastActivityDate
DateTime.Now, // lastPasswordChangedDate
new DateTime(1980, 1, 1) // lastLockoutDate
);
return user;

}
public override bool ChangePassword(string username, string
oldPassword, string newPassword)
{
if (DMHealth.CheckPW(username, oldPassword))
{
//newPassword = DMHealth.MyEncrypt(newPassword);//¤£¥[±K
string sSql = string.Empty;
if (username == DMHealth.sAd)
{
sSql = "Update SystemSet set Setting='" + newPassword +
"' where Item='" + DMHealth.sAd + "'";
Se.SetKey(DMHealth.sAd, newPassword);
}
else
{
int iYears = DMHealth.GetYearsFromUserID(username);
string sYears = iYears.ToString();
int iClassID = DMHealth.GetClassIDFromUserID(username);
string sClassID = iClassID.ToString();
sSql = "Update YearsClass set PW='" + newPassword + "'
where Years=" + sYears + " and ClassID=" + sClassID;
}
WillNs.DM.ExecuteNonQuery(sSql);
//FailureText.Text = "±K½X§ó§ï¦¨¥\";
return true;
}
else
{
//FailureText.Text = "±K½X¿ù»~";
return false;
}
}
public override void Initialize(string name,
System.Collections.Specialized.NameValueCollection config)
{
base.Initialize(name, config);
_passwordFormat = getPasswordFormat();
string sMin=config["minRequiredPasswordLength"].ToString();
sMin = WillNs.Util.GetDefault(sMin, "4");
_MinRequiredPasswordLength = int.Parse(sMin);
}

public override bool ValidateUser(string username, string password)
{
bool Authenticated = false;
Authenticated = DMHealth.CheckPW(username, password);
if (Authenticated)
{
HttpContext.Current.Session.Abandon();
new AuthenticationSuccessEvent(username, this).Raise();


return true;
}
else
{
new AuthenticationFailureEvent(username, this).Raise();
return false;
}
}

protected FormsAuthenticationUserCollection getUsers()
{
if (_users == null)
{
AuthenticationSection section = getAuthenticationSection();
FormsAuthenticationCredentials creds =
section.Forms.Credentials;
_users = section.Forms.Credentials.Users;
}

return _users;
}

protected AuthenticationSection getAuthenticationSection()
{
Configuration config =
WebConfigurationManager.OpenWebConfiguration("~");
return
(AuthenticationSection)config.GetSection("system.w eb/authentication");
}

protected FormsAuthPasswordFormat getPasswordFormat()
{
return
getAuthenticationSection().Forms.Credentials.Passw ordFormat;
}
protected MembershipSection getMembershipSection()
{
Configuration config =
WebConfigurationManager.OpenWebConfiguration("~");
return
(MembershipSection)config.GetSection("system.web/Membership");
}
}


"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com¼¶¼g©ó¶l¥ó·s»D:A2*** *******************************@microsoft.com...
Are you using Forms Authentication? You really haven't provided much
information at all here. Do you want to post some sample code?
Peter

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


"ad" wrote:
>I use login control of VS2005 in my web application.
The web applicaiton is developed in my notebook.
It run ok in my notebook,
but when I login in from another PC with the user ID and password, it
can't
login in.

I tried again and again. When I login with incorrect password, the login
control display the FailureText.
But when I enter the correct password, the Failure Text disappear but it
still stay in the login page.

How can I do?

Jul 11 '06 #3

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

Similar topics

1
by: Hozi | last post by:
I am getting the below error when asp.net tries to parse the .aspx file. The funny part is that the error only seems to be happening when viewing the page throuh IE 6 and not Netscape browsers. I...
6
by: Tim Cartwright | last post by:
I have a page that has the login control on it, nothing else. This page inherits from a master page, neither page has any code in it. This page works perfectly when running on the WebDev debug web...
0
by: Pawan Narula via DotNetMonster.com | last post by:
hi all, i'm using VB.NET and trying to code for contact management in a tree. all my contacts r saved in a text file and my C dll reads them one by one and sends to VB callback in a sync mode...
1
by: Marc | last post by:
Hi! I'm working with a C# client that calls a php web service. I've created a wrapper to call the service using .NET wsdl tool (adding a web reference). The call to the server works fine, it...
1
by: Jeff Lynch | last post by:
I'd like to add the following attributes to the Login control's Login Button to create a CSS rollover effect. How can I access the control's login button from the page's code-behind? ...
2
by: IdleBrain | last post by:
Hello All: I used a Login control to authenticate a user to login. The problem is that when I login with good username & password, the login view would say that the login was successful. But...
5
by: nasse | last post by:
I am getting the following error msg whenever I try to login. I tried to turn my output_buffering = On in my php.ini but is not working for me. Would you please help me: Warning: Cannot modify...
11
by: craigtomo | last post by:
i have changed my login .php file to the following this file is opened directly and is not called from any other file <?php // dBase file $host=""; // Host name $username=""; // Mysql...
1
by: pauld | last post by:
Hello - I have created a simple web application in VS 2005/ASP.net 2.0 for a university department to track problems with a new website that I have built for them. The app consists of an Access...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.