Wednesday, November 29, 2017

ASP.NET : Lock user for day after 3 invalid login attempt

In this article I am going to explain how to lock the user for day after 3 invalid login attempt in asp.net.

Description:
I want to lock the users for a day after 3 invalid login attempt. For example if user try to login on 25 November with 3 wrong password attempt, he/she will be locked for 25 November. He/she can’t login even enter correct password. He will be able to login on 26 November.  

Implementation:
I have created a table user_login


ASP.NET : Lock user for  day after 3 invalid login attempt

Saturday, November 25, 2017

MVC : Show confirmation message before submit, update or delete record

In this article I am going to explain how to show confirmation message before submit, update or delete record in MVC.

Description:
I want to show a confirmation message before perform any task like submit, update or delete the data. To implement this functionality you have to set onclick action of button or actionlink.

Implementation:
You have two different ways to implement this. First simply on button or actionlink use confirm as shown below:
<input type="submit" value="Create" onclick="return confirm('Are you sure want to create user?')" />       

Second using Jquery. Create Jquery function and call that on Onclick event as shown below:
<script>
    function Confirmmessage() {
        var alert = confirm("Are you sure want to create user?");
        if (alert) {
            return true;
        } else {
            return false;
        }
    }
</script>
Button:
<input type="submit" value="Create" onclick="return Confirmmessage()" />

I have create working example of create users for application.
Model (Login.cs)

How to send email from asp.net MVC application using web.config

In this article I am going to explain how to send email from asp.net MVC application using web.config
. 
Description:
If you don’t have SMTP server to send email then you can use Gmail smtp server to send email from your MVC application. To send email from web.config file you have to            set appsetting.
  
Implementation:
Open the web.config file of project. Set key in appsettings. After that mailsettings as shown below:

Sunday, November 19, 2017

MVC : Send email using Gmail account

In this article I am going to explain how to send email using Gmail account in asp.net MVC.

Description:
If you don’t have SMTP server to send email then you can use Gmail smtp server to send email from your MVC application.
  
Implementation:
Open the web.config file of project. Set key in appsettings. After that mailsettings as shown below:

Sunday, November 12, 2017

How to show confirmation message in MVC

In this article I am going to explain how to show confirmation message in MVC.

Description:
I want to show a confirmation message before perform any task like submit, update or delete the data. To implement this functionality you have to set onclick action of button or actionlink.

Implementation:
You have two different ways to implement this. First simply on button or actionlink use confirm as shown below:

<input type="submit" value="Create" onclick="return confirm('Are you sure want to create user?')" />  
   
Second using Jquery. Create Jquery function and call that on Onclick event as shown below:

<script>
    function Confirmmessage() {
        var alert = confirm("Are you sure want to create user?");
        if (alert) {
            return true;
        } else {
            return false;
        }
    }
</script>

Button:
<input type="submit" value="Create" onclick="return Confirmmessage()" />

I have create working example of create users for application.

Model (Login.cs)

Thursday, November 9, 2017

[Solved]: [Provided: Named Pipes Provider, error: 40- Could not open a connection to the SQL Server (Microsoft SQL Server, Error: 2)]

In this article I am going to explain how to resolve the Error: [Provided: Named Pipes Provider, error: 40- Could not open a connection to the SQL Server (Microsoft SQL Server, Error: 2)]

Description:
When I am trying to connect the Sql server, got an error:

Sunday, November 5, 2017

How to show message in popup in asp.net MVC

In this article I am going to explain how to show message in popup in asp.net MVC.

Description:
I want to show success message in popup after submit the data. We can show message in popup using jquery or HTML raw.

Implementation:
I have create a class Login to create users. When user created successfully show success message in popup.

Model (Login.cs)