Click here to Skip to main content
14,639,480 members
Home » Discussions » ASP.NET
   

ASP.NET

 
GeneralRe: How to implement https for mvc site Pin
Nathan Minier27-Dec-17 7:19
professionalNathan Minier27-Dec-17 7:19 
SuggestionRe: How to implement https for mvc site Pin
Richard Deeming8-Jan-18 6:44
mveRichard Deeming8-Jan-18 6:44 
GeneralRe: How to implement https for mvc site Pin
A_Griffin8-Jan-18 6:46
MemberA_Griffin8-Jan-18 6:46 
QuestionASP.Net MVC:How to implement Elmah in separate project Pin
Mou_kol22-Dec-17 5:01
MemberMou_kol22-Dec-17 5:01 
AnswerRe: ASP.Net MVC:How to implement Elmah in separate project Pin
jkirkerx22-Dec-17 10:12
professionaljkirkerx22-Dec-17 10:12 
Questionint retryattempts = Convert.ToInt32(dr["retryattempts"]); Pin
Lay_Kay21-Dec-17 3:39
MemberLay_Kay21-Dec-17 3:39 
AnswerRe: int retryattempts = Convert.ToInt32(dr["retryattempts"]); Pin
David Mujica21-Dec-17 4:54
MemberDavid Mujica21-Dec-17 4:54 
GeneralRe: int retryattempts = Convert.ToInt32(dr["retryattempts"]); Pin
Lay_Kay21-Dec-17 17:50
MemberLay_Kay21-Dec-17 17:50 
Thanks for your response! Here is the entire code.

using (SqlConnection con = new SqlConnection(CS))
{
SqlCommand cmd = new SqlCommand("sp_AuthenticateUser", con);
cmd.CommandType = CommandType.StoredProcedure;

SqlParameter paramUsername = new SqlParameter("@Username", username);
SqlParameter paramPassword = new SqlParameter("@Password", password);

cmd.Parameters.Add(paramUsername);
cmd.Parameters.Add(paramPassword);

con.Open();
// int ReturnCode = Convert.ToInt32(cmd.ExecuteScalar());

SqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
int RetryAttempts = Convert.ToInt32(rdr["RetryAttempts"]);
if (Convert.ToBoolean(rdr["AccountLocked"]))
{
lblMessage.Text = "Account is locked. Please contact your Web Administrator!";
}
else if (RetryAttempts > 0)
{
int AttemptsLeft = (4 - RetryAttempts); // allow 4 attempts

lblMessage.Visible = true;
lblMessage.Text = "Invalid username and/or password. " +
AttemptsLeft.ToString() + " attempt(s) left";
}

else if (Convert.ToBoolean(rdr["Authenticated"]))
{
FormsAuthentication.RedirectFromLoginPage(txtUser.Text, chk_Remember.Checked);
Response.Redirect("../index.aspx");
}


}

}
SuggestionRe: int retryattempts = Convert.ToInt32(dr["retryattempts"]); Pin
Richard Deeming22-Dec-17 2:08
mveRichard Deeming22-Dec-17 2:08 
AnswerRe: int retryattempts = Convert.ToInt32(dr["retryattempts"]); Pin
Richard Deeming22-Dec-17 2:11
mveRichard Deeming22-Dec-17 2:11 
GeneralRe: int retryattempts = Convert.ToInt32(dr["retryattempts"]); Pin
Lay_Kay22-Dec-17 5:19
MemberLay_Kay22-Dec-17 5:19 
AnswerRe: int retryattempts = Convert.ToInt32(dr["retryattempts"]); Pin
Richard MacCutchan21-Dec-17 5:18
mveRichard MacCutchan21-Dec-17 5:18 
QuestionHow to ensure user either checks a box or fills out the form? Pin
samflex18-Dec-17 7:48
Membersamflex18-Dec-17 7:48 
QuestionAdvice on Partial View Pin
sunsher17-Dec-17 2:37
Membersunsher17-Dec-17 2:37 
Questionmaintain position DIV on Postback Pin
Member 1317428015-Dec-17 5:42
MemberMember 1317428015-Dec-17 5:42 
AnswerRe: maintain position DIV on Postback Pin
jkirkerx18-Dec-17 8:17
professionaljkirkerx18-Dec-17 8:17 
GeneralRe: maintain position DIV on Postback Pin
Member 1317428018-Dec-17 23:41
MemberMember 1317428018-Dec-17 23:41 
QuestionProblem consuming soap web service - content mismatch Pin
anto200515-Dec-17 5:42
Memberanto200515-Dec-17 5:42 
AnswerRe: Problem consuming soap web service - content mismatch Pin
Richard Deeming18-Dec-17 2:40
mveRichard Deeming18-Dec-17 2:40 
GeneralRe: Problem consuming soap web service - content mismatch Pin
anto200518-Dec-17 5:44
Memberanto200518-Dec-17 5:44 
GeneralRe: Problem consuming soap web service - content mismatch Pin
Richard Deeming18-Dec-17 6:34
mveRichard Deeming18-Dec-17 6:34 
QuestionHow to fix error "the type or namespace name 'CustomerBAL' could not be found (are you missing a using directive or an assembly reference) Pin
Member 1357490013-Dec-17 21:50
MemberMember 1357490013-Dec-17 21:50 
AnswerRe: How to fix error "the type or namespace name 'CustomerBAL' could not be found (are you missing a using directive or an assembly reference) Pin
pt140113-Dec-17 22:00
Memberpt140113-Dec-17 22:00 
GeneralRe: How to fix error "the type or namespace name 'CustomerBAL' could not be found (are you missing a using directive or an assembly reference) Pin
Member 1357490013-Dec-17 22:56
MemberMember 1357490013-Dec-17 22:56 
QuestionHow to incorporate pagination feature into my repository Pin
Mou_kol13-Dec-17 3:31
MemberMou_kol13-Dec-17 3:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.