Web
Analytics
Custom User Login form using ASP.Net MVC LINQ Jquery JSON - Tutorial

For Consultation : +91 9887575540

Stay Connected :

Custom User Login form using ASP.Net MVC LINQ Jquery JSON

In this blog tutorial we will see that how we can create custom login form using MVC, LINQ, jquery and json.Here I am using $.getJSON method of jquery.

Step1. Create new Empty MVC Project

Open Visual Studio->New Project->Visual C#->Web->ASP.NET Web application->Give Project Name->Select Empty Template->Check MVC Checkbox->Click OK

Step 2. Now to we will add LINQ to sql classes(dbml) in Models folder .

Right click on Model folder =>select new Item->Select Data tab at left side in opened window->Select LINQ to sql classes in middle.->Give the name of your dbml file(here DataClasses1.dbml)




Step 3. Connect with sql database .We have to create sql database in sql server management studio.I supposed you  already created it so I am not telling way to create it.

Open server explorer(Ctrl+alt+s)->Right click on data connection and select add connection->Enter your sql server name->Select Database(my Database name is Ganesha).

(In this process DataClasses1DataContext will be created in models folder)

Demo Database Table

LINQ_Jquery_MVC

Sql query to generate database table

 





Step 4. In server explorer window expand newly added(ganesha) database->Drag and drop Login Table on design serface.+Ctrl S

(It will add Login model in DataClasses1DataContext)

Step 5. Create controller in controller folder-> Select Create Empty controller ->Controller Name(Here CustomLogin)=>OK(This Controller Index action will read another action in same Custom Login Controller)

Step 6: Create Images folder and add ajax_linq_MVC.png.(Download (Search ajaxloader.gif image)it from internet)

 

Pass namespace using LINQCRUD.Models

Write following code in CustomLogin Controller

 

 

Add Login View(Login.cshtml) with Login Action

Login.cshtml

 

 


Output

LINQ_AJAX_ASP.NETMVC

 

Download Source Code

Select your currency