Skip to content
Home » Ajax Call In Jquery Mvc | Benefits Of Ajax

Ajax Call In Jquery Mvc | Benefits Of Ajax

Ajax calls to .Net5 MVC Controllers (using JQuery)

Benefits of Ajax

  • Callbacks
  • Making Asynchronous Calls
  • User-Friendly
  • Improve the speed, performance and usability of a web application

Implementation of Ajax can be done in two way in ASP.Net Application

  • using Update Panel and,
  • using jQuery

What Advances have Been Made to Ajax?

JavaScript is the client-side scripting language and XML is a mark-up language to define data. And we have, JSON(JavaScript Object Notation) as another mark-up language to define data as well. JSON is much easier to use with JavaScript than XML. After the combination of JavaScript and Ajax, the XML Web Services are being replaced by JSON Web Services.

Another major advance to JavaScript and Ajax is the JavaScript object library called jQuery, which is the free, open-source software. It is a wrapper for JavaScript. jQuery is used to write the JavaScript to navigate and manipulate a page and make asynchronous Ajax callbacks.

Hence, Ajax callbacks have become standard programming practices by using jQuery and JSON Web Services for designing and developing web applications.

Ajax Call Getting started

$(function () { $(“#btnGet”).click(function () { var empIds = $(“#txtId”).val(); var empNames = $(“#txtName”).val(); var empSalarys = $(“#txtSalary”).val(); $.ajax({ type: “POST”, url: “/Home/AjaxMethod”, data: ‘{empId: “‘ + empIds + ‘” , empName: “‘ + empNames + ‘” , empSalary: “‘ + empSalarys + ‘” }’, contentType: “application/json; charset=utf-8”, dataType: “json”, success: function (response) { alert(“Hello: ” + response.EmpName + ” Your Employee Id Is: ” + response.EmpId + “And Your Salary Is: ” + response.EmpSalary); }, failure: function (response) { alert(response.responseText); }, error: function (response) { alert(response.responseText); } }); }); });

[HttpPost] public JsonResult AjaxMethod(string empId, string empName, string empSalary) { PersonModel person = new PersonModel { EmpId = empId, EmpName = empName, EmpSalary = empSalary }; return Json(person); }

// second $(function () { $(“#btnGet2”).click(function () { debugger; var empIds = $(“#txtId”).val(); var empNames = $(“#txtName”).val(); var empSalarys = $(“#txtSalary”).val(); $.ajax({ url: “/Home/AjaxMethod”, dataType: “json”, type: “POST”, cache: false, data: { empId: empIds, empName: empNames, empSalary: empSalarys }, success: function (response) { alert(“Hello: ” + response.EmpName + ” Your Employee Id Is: ” + response.EmpId + “And Your Salary Is: ” + response.EmpSalary); }, failure: function (response) { alert(response.responseText); }, error: function (response) { alert(response.responseText); } }) }) });

[HttpPost] public JsonResult AjaxMethod(string empId, string empName, string empSalary) { PersonModel person = new PersonModel { EmpId = empId, EmpName = empName, EmpSalary = empSalary }; return Json(person); }

//third $(function () { $(“#btnGet3”).click(function () { var intrestedInAll = { EmpId: $(“#txtId”).val(), EmpName: $(“#txtName”).val(), EmpSalary: $(“#txtSalary”).val(), }; debugger; $.ajax({ url: ‘/Home/AjaxMethodWithObject’, type: ‘POST’, data: { “queryFilter”: JSON.stringify(intrestedInAll) }, cache: false, success: function (response) { alert(“Hello: ” + response.EmpName + ” Your Employee Id Is: ” + response.EmpId + “And Your Salary Is: ” + response.EmpSalary); }, failure: function (response) { alert(response.responseText); }, error: function (response) { alert(response.responseText); } }); }); });

[HttpPost] public JsonResult AjaxMethodWithObject(string queryFilter) { PersonModel personModel = JsonConvert.DeserializeObject (queryFilter); return Json(personModel); }

//fourth $(function () { $(“#btnGet4”).click(function () { var personModel = { EmpId: $(“#txtId”).val(), EmpName: $(“#txtName”).val(), EmpSalary: $(“#txtSalary”).val(), }; personModel = JSON.stringify(personModel); debugger; $.ajax({ type: “POST”, url: “/Home/AjaxMethodWithModel”, data: personModel, dataType: “json”, contentType: ‘application/json; charset=utf-8’, success: function (response) { alert(“Hello: ” + response.EmpName + ” Your Employee Id Is: ” + response.EmpId + “And Your Salary Is: ” + response.EmpSalary); }, failure: function (response) { alert(response.responseText); }, error: function (response) { alert(response.responseText); } }); }); });

[HttpPost] public JsonResult AjaxMethodWithModel(PersonModel personModel) { PersonModel person = new PersonModel { EmpId = personModel.EmpId, EmpName = personModel.EmpName, EmpSalary = personModel.EmpSalary }; return Json(person); }

//fifth function GetAjaxDataPromise(url, postData) { debugger; var promise = $.post(url, postData, function (promise, status) { }); return promise; }; $(function () { $(“#btnGet5”).click(function () { debugger; var promises = GetAjaxDataPromise(‘@Url.Action(“AjaxMethod”, “Home”)’, { EmpId: $(“#txtId”).val(), EmpName: $(“#txtName”).val(), EmpSalary: $(“#txtSalary”).val() }); promises.done(function (response) { debugger; alert(“Hello: ” + response.EmpName + ” Your Employee Id Is: ” + response.EmpId + “And Your Salary Is: ” + response.EmpSalary); }); }); });

[HttpPost] public JsonResult AjaxMethod(string empId, string empName, string empSalary) { PersonModel person = new PersonModel { EmpId = empId, EmpName = empName, EmpSalary = empSalary }; return Json(person); }

[HttpPost] public JsonResult AjaxMethodWithModel(PersonModel personModel) { PersonModel person = new PersonModel { EmpId = personModel.EmpId, EmpName = personModel.EmpName, EmpSalary = personModel.EmpSalary }; return Json(person); }

The complete code for controller is

public class HomeController : Controller { public ActionResult Index() { return View(); } [HttpPost] public JsonResult AjaxMethod(string empId, string empName, string empSalary) { PersonModel person = new PersonModel { EmpId = empId, EmpName = empName, EmpSalary = empSalary }; return Json(person); } [HttpPost] public JsonResult AjaxMethodWithObject(string queryFilter) { PersonModel personModel = JsonConvert.DeserializeObject (queryFilter); return Json(personModel); } [HttpPost] public JsonResult AjaxMethodWithModel(PersonModel personModel) { PersonModel person = new PersonModel { EmpId = personModel.EmpId, EmpName = personModel.EmpName, EmpSalary = personModel.EmpSalary }; return Json(person); } }

Response-

So When jquery ajax request completed you can check the response from success method. You can check in the examples above. So this is how we can use Ajax in Asp.Net MVC.

In this article I will explain with an example, how to use jQuery AJAX and JSON in ASP.Net MVC 5 Razor.
The Controller action method will be called using jQuery AJAX and JSON from View in ASP.Net MVC 5 Razor.

Model

Following is a Model class named PersonModel with two properties i.e. Name and DateTime.

public class PersonModel

///

/// Gets or sets Name.

///

public string Name { get; set; }

///

/// Gets or sets DateTime.

///

public string DateTime { get; set; }

Controller

The Controller consists of two Action methods.

Action method for handling GET operation

Inside this Action method, simply the View is returned.

Action method for handling jQuery AJAX operation

This Action method handles the call made from the jQuery AJAX function from the View.

Note: The following Action method handles AJAX calls and hence the return type is set to JsonResult.

The value of the name parameter is assigned to the Name property of the PersonModel object along with the Current DateTime and finally the PersonModel object is returned back as JSON to the jQuery AJAX function.

public class HomeController : Controller

// GET: Home

public ActionResult Index()

return View();

[HttpPost]

public JsonResult AjaxMethod(string name)

PersonModel person = new PersonModel

Name = name,

DateTime = DateTime.Now.ToString()

};

return Json(person);

View

Next step is to add a View for the Controller and while adding you will need to select the PersonModel class created earlier.

Inside the View, in the very first line the PersonModel class is declared as Model for the View. The View consists of an HTML TextBox element and a Button. The Button has been assigned a jQuery click event handler and when the Button is clicked a jQuery AJAX called is made to the Controller’s action method.

The following figure describes a jQuery AJAX call in ASP.Net MVC

The URL for the jQuery AJAX call is set to the Controller’s action method i.e. /Home/AjaxMethod. The value of the TextBox is passed as parameter and the returned response is displayed using JavaScript Alert Message Box.

@model jQuery_AJAX_MVC.Models.PersonModel

@{

Layout = null;

<br /> Index<br />

Screenshot

Downloads

This article gives you details about how you can implement jQuery AJAX calls to ASP.NET MVC controller and display JSONResult on view.

For this tutorial, we will use the Northwind database. If you do not have Northwind database you can download from here.

You will have a DropDownList filled with Northwind.Categories table. You may check for ways to bind MVC DropDownList. On selection change of this DropDownList, a jQuery Ajax call will be made to the controller. The controller will return JSONResult and success part of ajax call will display JSONResult.

Follow the below steps to implement jQuery AJAX call to MVC Controller and display JSON result.

Open your Visual Studio and create a empty ASP.NET MVC application.

Click on File -> New Project -> Web -> ASP.NET web application.

From the next window Select template Empty and from Add folders and core reference choose MVC.

Name it as AJAXCalls and click Ok. For more details check Getting Started with ASP.NET MVC.

We will use a model class to represet the Product entity.

Right click on Models folder and select Add -> Class name it as Product -> click Ok.

Add below properties for the Product model.


namespace AJAXCalls.Models { public class Product { public string ProductID { get; set; } public string ProductName { get; set; } public string QuantityPerUnit { get; set; } public string UnitPrice { get; set; } public string UnitsInStock { get; set; } public string ReorderLevel { get; set; } } }

For detail description see ASP.NET MVC model example.

In this step, you will add a simple controller. Right click on the Controllers folder and select Add -> Controller.

From Add Scaffold window select MVC 5 Controller – Empty and click Add.

Name it as HomeController.

Open HomeController from the Controllers folder and add Action method with name ShowCategoryProducts. For more details about Action method ASP.NET MVC Controller Action Method and Action Result.

Add the below code to ShowCategoryProducts


public ActionResult ShowCategoryProducts() { List

items = new List

(); items.Add(new SelectListItem { Text = "Select Category", Value = "0", Selected = true }); items.Add(new SelectListItem { Text = "Beverages", Value = "1" }); items.Add(new SelectListItem { Text = "Condiments", Value = "2" }); items.Add(new SelectListItem { Text = "Confections", Value = "3" }); items.Add(new SelectListItem { Text = "Dairy Products", Value = "4" }); items.Add(new SelectListItem { Text = "Grains/Cereals", Value = "5" }); items.Add(new SelectListItem { Text = "Meat/Poultry", Value = "6" }); items.Add(new SelectListItem { Text = "Produce", Value = "7" }); items.Add(new SelectListItem { Text = "Seafood", Value = "8" }); ViewBag.CategoryType = items; return View(); }


It adds Category details to ViewBag property. These property values will be shown in Category Type DropDownList.

In this step, you will add an MVC View to display Category and Product details.

Open HomeController from Controllers folder -> Go to ShowCategoryProducts action method -> right click and select Add View

It adds a View under Views -> Home folder with the name ShowCategoryProducts.cshmtl.

Now add a DropDownList to display Categories and empty Table to show products depending on the selected category.

Add below html to ShowCategoryProducts.cshtml


@{ ViewBag.Title = "jQuery Ajax Call example in ASP.NET MVC - dotnetmentors.com"; }

jQuery Ajax Call example in ASP.NET MVC - dotnetmentors.com

@using (Html.BeginForm("CategoryChosen", "Home", FormMethod.Get)) {

Category Type : @Html.DropDownList("CategoryType")
ProductID ProductName QuantityPerUnit UnitPrice UnitsInStock ReorderLevel

}

Open HomeController and action method which accepts Category ID as an input parameter, create a list of products whose CategoryID is equal to input parameter and return it as JSON result.

If you have data in the DataTable or Dataset you can convert datatable to JSON string.

Add below Action method to HomeController


public JsonResult GetProducts(string id) { List products = new List (); string query = string.Format("SELECT [ProductID], [ProductName], [QuantityPerUnit],[UnitPrice],[UnitsInStock],[ReorderLevel] " + " FROM [Northwind].[dbo].[Products] WHERE CategoryID = {0}",id); using (SqlConnection con = new SqlConnection("your connection string")) { using (SqlCommand cmd = new SqlCommand(query, con)) { con.Open(); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { products.Add( new Product { ProductID = reader.GetValue(0).ToString(), ProductName = reader.GetString(1), QuantityPerUnit = reader.GetString(2), UnitPrice = reader.GetValue(3).ToString(), UnitsInStock = reader.GetValue(4).ToString(), ReorderLevel = reader.GetValue(5).ToString() } ); } } } return Json(products, JsonRequestBehavior.AllowGet); }

It creates a list of Products model and returns as JSON.

In this step, you will add code for CategoryType DropDownList change event. This will create the AJAX helper to call the MVC controller action method.

Below is the code which fires on change of DropDownList, create an AJAX call with required details, makes a call to GetProducts controller action method, accepts JSON result, and display as a Table object.

Add it after of the above code which you added in step 4.

On success it displays the JSON string returned by action method, manipulate it and display product details on View.

Execute your application and browse to http://localhost: /home/ShowCategoryProducts.

Select any value from CategoryType DropDownList. It makes an AJAX call to fill Products table. It display below screen.

In this article, you will learn how to consume/use Web API in ASP.NET MVC step by step.

This article is the third part of my ASP.NET MVC Web API series.

Consuming Web API From jQuery

In this article, we have used localhost Web API and called for the GET request. The following is the process:

  • Create ASP.NET MVC Project.
  • Add an HTML file called Members.html file.
  • Write GET call of for jQuery AJAX to fetch the data from ASP.NET Web API.
  • System or process will throw two different errors.
  • Resolve the errors with the solution given in this article.
  • Run the project and check the output.

Step by Step Implementation

Create an new ASP.NET Empty Website project called “ConsumeWebApiFromJquery”.

By default, the Solution Explorer looks like this.

Now, right-click on the project titled “ConsumeWebApiFromJquery” and select ADD –> ADD NEW ITEM –> HTML Page. Give the page a name as “Members.html”.

Switch to Members.html file and add the following code.

  1. Ajax calls to .Net5 MVC Controllers (using JQuery)
    Ajax calls to .Net5 MVC Controllers (using JQuery)

    What is Ajax?

    As we all know, AJAX means Asynchronous JavaScript and XML. It is a client-side script that communicates to and from a server/database without the need for a postback or a complete page refresh. The Ajax speeds up response time.

    In other words, Ajax is the method of exchanging data with a server, and updating parts of a web page, without reloading the entire page.

    Using Ajax in Asp.Net MVC

    Ajax

    So starting of from the beginning Ajax is used for Asynchronous Javascript and XML. We can use it for many purposes. Few basic uses of Ajax are:-

    • Update page without reloading the page providing better performance.
    • Request data from a server – after the page has loaded which can be used in loading Partial Views.
    • Send data to a server without reload – in the background making it easier to performance Save, Delete operations smoothly.

    Ajax in Asp.Net MVC

    Ajax can be used anywhere where we can use jquery. But we will be watching few examples of different ways of using Ajax in Asp.Net MVC. We will be posting data on MVC Controller without refreshing the page. So let’s start from beginning:-

    Step-1

    So , first of all we will be creating a new view and adding few field on it . Now we will be trying to send the values of these fields on controller without reload and especially using Ajax.

    So We will add a new view and few fields on it.

    @{ ViewBag.Title = “Home Page”; }

    (#39) Get data using ajax in mvc | mvc tutorial for beginners in .net c#
    (#39) Get data using ajax in mvc | mvc tutorial for beginners in .net c#

    Demonstration: Implementation of Ajax using jQuery

    Step 1

    Create a new Project and choose ASP.NET MVC web application.

    Step 2

    Just Ignore the built-in Models and Controllers and make your own model.

    Here I am creating a model called “Students” having properties studentID, studentName and studentAddress as shown below,


    public class Student
    {
    [Key]
    public int studentID { get; set; }
    [Required]
    public string studentName { get; set; }
    [Required]
    public string studentAddress { get; set; }
    }

    Add “using System.ComponentModel.DataAnnotations;” Attributes to Validate Model Data and then build the project once.

    Step 3

    Let’s create another model by inheriting the DbContext. It is a class that manages all the database operations, like database connection, and manages various entities of the Entity Model.

    We can also say DbContext is a wrapper of ObjectContext. So, DbContext is a lightweight version of the ObjectContext and is exposes only the common features that are really required in programming.

    Here I am creating a model called “StudentContext” as shown below,


    public class StudentContext : DbContext
    {
    public DbSet

    Students { get; set; }
    }

    Add “using System.Data.Entity;” that provides access to the core functionality of the entity framework.

    Step 4

    Now create a controller to written the code for inserting data into database, displaying data into view.

    Here I am creating “Student” controller. Inside the Controller, I am creating an object of StudentContext for inserting and retrieving data from database. Also add the necessary namespace.


    StudentContext context = new StudentContext();

    Step 5

    Now I’m creating the action methods for Inserting and retrieving the data to/from the database.

    Here I am creating an [HttpPost] action method “createStudent” for inserting the JSON-Formatted data to database. I am Using [HttpPost] attribute to Save/Post the data as below:


    [HttpPost]
    public ActionResult createStudent(Student std)
    {
    context.Students.Add(std);
    context.SaveChanges();
    string message = "SUCCESS";
    return Json(new { Message = message, JsonRequestBehavior.AllowGet });
    }

    Similarly, I am also creating JSON method “getStudent” to retrieve data from database and returning raw JSON data to be consumed by JavaScript in view as shown below,


    public JsonResult getStudent(string id)
    {
    List

    students = new List

    ();
    students = context.Students.ToList();
    return Json(students, JsonRequestBehavior.AllowGet);
    }


    Step 6

    Now add a view to display the data and data inserting field. Here, I am adding a view named “Index.cshtml”. Then, write the HTML codes for making the data input field, submit button and also for displaying the data in same page. You can use bootstrap classes for designing. Here I am using bootstrap. My designing code is as below:

    Please enter the details below.

    ID Student Name Student Address

    We can simply use the bootstrap class and call jQuery functions in ASP.NET MVC because during the project creation it will by default added to project and also linked to the template.

    Step 7

    Now I will write the script for inserting the data as well as retrieving and displaying it to the view. Just after the HTML code finished add the script shown below,


    @section Scripts
    {

    }

    We are using Ajax to refresh “tblStudent” so it refreshes only the particular table, rather than refreshing entire page. After clicking the “submitButton” the data from the input fields are taken in variable and redirected to action “createStudent” of “StudentController” to insert into the database. And, I have written a function “LoadData” to display the data from database to view continuously after inserting data. Inside “LoadData” function I am calling “getStudent” method which returns result in JSON and the JSON-Formatted data are presented in html by the underlying statements.

    Step 8

    Now, configure the Database connectionStrings in “web.config” file of the particular project as shown below,

    In the above connectingString “StudentContext” is the name of class inherited from abstract Class “DbContext” in “StudentContext.cs” file. “RAVI-KANDEL” is the name of the Database Server and “Student” is the name of the Database. Change “RAVI-KANDEL” with your Database Server name. Finally, run your application and navigate to Student controller. Also you can configure “RouteConfig.cs” and set the controller to “Student” for direct navigation to the Student controller when loading the application.

    You can add the records and can see added data in the table after the form-control as shown below,

    Also, you can open the database server and see the data stored in database over there.

    Please feel free to comment/feedback.

    Happy Coding!

    jQuery Ajax() method is used to send Ajax requests or asynchronous HTTP requests to the servers for fetching and posting data according to the requirement by specifying the request type.

    Syntax:

    $.ajax({name:value, name:value, … })

    Parameters: The list of possible parameter that can be passed to an Ajax request are listed below:

    • type: It is used to specify the type of the request as POST or GET.
    • url: It is used to specify the URL to send the request to.
    • username: It is used to specify a username to be used in an HTTP access authentication request.
    • xhr: It is used for creating the XMLHttpRequest object.
    • async: Its default value is true. It indicates whether the request should be handled asynchronously or not.
    • beforeSend(xhr): It is a function that is to be run before the request is sent.
    • dataType: The data type expected of the server response.
    • error(xhr, status, error): It is used to run if the request fails.
    • global: Its default value is true. It is used to specify whether or not to trigger global AJAX event handles for the request.
    • ifModified: It’s default value is false. It is used to specify whether a request is only successful if the response has changed since the last request.
    • jsonp: A string overriding the callback function in a jsonp request.
    • jsonpCallback: It is used to specify a name for the callback function in a jsonp request.
    • cache: It’s default value is true. It indicates whether the browser should cache the requested pages.
    • complete(xhr, status): It is a function which is to be run when the request is being finished.
    • contentType: It’s default value is: “application/x-www-form-urlencoded” and it is used when data send to the server.
    • context: It is used to specify the “this” value for all AJAX related callback functions.
    • data: It is used to specify data to be sent to the server.
    • dataFilter(data, type): It is used to handle the raw response data of the XMLHttpRequest.
    • password: It is used to specify a password to be used in an HTTP access authentication request.
    • processData: It’s default value is true. It is used to specify whether or not data sent with the request should be transformed into a query string.
    • scriptCharset: It is used to specify the charset for the request.
    • success(result, status, xhr): It is to be run when the request succeeds.
    • timeout: It is the local timeout for the request. It measured in terms of milliseconds.
    • traditional: It is used to specify whether or not to use the traditional style of param serialization.

    Example 1: This example use ajax() method to add the text content from outer text file by sending ajax request.

    Ajax Call Getting started

    @{ ViewBag.Title = “Home Page”; }

    Use jQuery AJAX in ASP.NET CORE 6?  You NEED to see how it´s done!
    Use jQuery AJAX in ASP.NET CORE 6? You NEED to see how it´s done!

    Demonstration: Implementation of Ajax using jQuery

    Step 1

    Create a new Project and choose ASP.NET MVC web application.

    Step 2

    Just Ignore the built-in Models and Controllers and make your own model.

    Here I am creating a model called “Students” having properties studentID, studentName and studentAddress as shown below,


    public class Student
    {
    [Key]
    public int studentID { get; set; }
    [Required]
    public string studentName { get; set; }
    [Required]
    public string studentAddress { get; set; }
    }

    Add “using System.ComponentModel.DataAnnotations;” Attributes to Validate Model Data and then build the project once.

    Step 3

    Let’s create another model by inheriting the DbContext. It is a class that manages all the database operations, like database connection, and manages various entities of the Entity Model.

    We can also say DbContext is a wrapper of ObjectContext. So, DbContext is a lightweight version of the ObjectContext and is exposes only the common features that are really required in programming.

    Here I am creating a model called “StudentContext” as shown below,


    public class StudentContext : DbContext
    {
    public DbSet

    Students { get; set; }
    }

    Add “using System.Data.Entity;” that provides access to the core functionality of the entity framework.

    Step 4

    Now create a controller to written the code for inserting data into database, displaying data into view.

    Here I am creating “Student” controller. Inside the Controller, I am creating an object of StudentContext for inserting and retrieving data from database. Also add the necessary namespace.


    StudentContext context = new StudentContext();

    Step 5

    Now I’m creating the action methods for Inserting and retrieving the data to/from the database.

    Here I am creating an [HttpPost] action method “createStudent” for inserting the JSON-Formatted data to database. I am Using [HttpPost] attribute to Save/Post the data as below:


    [HttpPost]
    public ActionResult createStudent(Student std)
    {
    context.Students.Add(std);
    context.SaveChanges();
    string message = "SUCCESS";
    return Json(new { Message = message, JsonRequestBehavior.AllowGet });
    }

    Similarly, I am also creating JSON method “getStudent” to retrieve data from database and returning raw JSON data to be consumed by JavaScript in view as shown below,


    public JsonResult getStudent(string id)
    {
    List

    students = new List

    ();
    students = context.Students.ToList();
    return Json(students, JsonRequestBehavior.AllowGet);
    }


    Step 6

    Now add a view to display the data and data inserting field. Here, I am adding a view named “Index.cshtml”. Then, write the HTML codes for making the data input field, submit button and also for displaying the data in same page. You can use bootstrap classes for designing. Here I am using bootstrap. My designing code is as below:

    Please enter the details below.

    ID Student Name Student Address

    We can simply use the bootstrap class and call jQuery functions in ASP.NET MVC because during the project creation it will by default added to project and also linked to the template.

    Step 7

    Now I will write the script for inserting the data as well as retrieving and displaying it to the view. Just after the HTML code finished add the script shown below,


    @section Scripts
    {

    }

    We are using Ajax to refresh “tblStudent” so it refreshes only the particular table, rather than refreshing entire page. After clicking the “submitButton” the data from the input fields are taken in variable and redirected to action “createStudent” of “StudentController” to insert into the database. And, I have written a function “LoadData” to display the data from database to view continuously after inserting data. Inside “LoadData” function I am calling “getStudent” method which returns result in JSON and the JSON-Formatted data are presented in html by the underlying statements.

    Step 8

    Now, configure the Database connectionStrings in “web.config” file of the particular project as shown below,

    In the above connectingString “StudentContext” is the name of class inherited from abstract Class “DbContext” in “StudentContext.cs” file. “RAVI-KANDEL” is the name of the Database Server and “Student” is the name of the Database. Change “RAVI-KANDEL” with your Database Server name. Finally, run your application and navigate to Student controller. Also you can configure “RouteConfig.cs” and set the controller to “Student” for direct navigation to the Student controller when loading the application.

    You can add the records and can see added data in the table after the form-control as shown below,

    Also, you can open the database server and see the data stored in database over there.

    Please feel free to comment/feedback.

    Happy Coding!

    Before diving into the core topic let’s have an overview about JQuery and Ajax. What is it? What is JQuery? Well, JQuery is a framework (tools) for writing JavaScript, Written as “write less, do more”, jQuery is to make easier to use JavaScript. What is JavaScript? JavaScript is an object-oriented computer programming (Scripting) language commonly used to create interactive effects within web browsers. Let’s have a sample example: We have a submit button in our JQuery AJAX MVC application. Let’s try to show a message when it is clicked. Here is our button with defined id=”btnSubmit”:

    Now we need to write some script to do that, here is some JavaScript code:

    1. var myBtn = document.getElementById(‘btnSubmit’);
    2. myBtn.addEventListener(‘click’, function(e) {
    3. e.preventDefault();
    4. alert(‘Hello’);
    5. });

    By this code the result will show “Hello”: Now if we can get the same result by using jQuery instead of it. Let’s have a look:

    1. $(‘#btnSubmit’).click(function(event) {
    2. event.preventDefault();
    3. alert(“Hello”);
    4. });

    Note: Here use of ‘e’ is just a short for event which raised the event. We can pass any variable name. Notice that the ‘e’ is changed to name ‘event’ in JQuery part. This piece of code is also producing the same result “Hello”. This is why jQuery is known as “write less, do more”. Finally the script:

    Let’s focus on Ajax: AJAX stands for “Asynchronous JavaScript and XML”. AJAX is about exchanging data with a server, without reloading the whole page. It is a technique for creating fast and dynamic web pages. In .NET, we can call server side code using two ways:

    1. ASP .NET AJAX
    2. jQuery AJAX

    In this article we will focus on JQuery Ajax. $.ajax () Method: JQuery’s core method for creating Ajax requests. Here are some jQuery AJAX methods:

    • $.ajax() Performs an async AJAX request.
    • $.get() Loads data from a server using an AJAX HTTP GET request.
    • $.post() Loads data from a server using an AJAX HTTP POST request.

    To know more click. $.ajax () Method Configuration option: Options that we use:

    • async:
    • type:
    • url:
    • data:
    • datatype:
    • success:
    • error:

    Let’s have details overview: async Set to false if the request should be sent synchronously. Defaults to true. Note that if you set this option to false, your request will block execution of other code until the response is received. Example:

    type This is type of HTTP Request and accepts a valid HTTP verb. The type of the request, “POST” or “GET” defaults to “GET”. Other request types, such as “PUT” and “DELETE” can be used, but they may not be supported by all the web browsers. Example:

    url The URL for the request. Example:

    data The data to be sent to the server. This can either be an object or a query string. Example:

    1. data: JSON.stringify(model_data),

    dataType The type of data you expect back from the server. By default, jQuery will look at the MIME type of the response if no dataType is specified. Accepted values are text, xml, json, script, html jsonp. Example:

    contentType This is the content type of the request you are making. The default is ‘application/x-www-form-urlencoded’. Example:

    1. contentType: ‘application/json; charset=utf-8’,

    success A callback function to run if the request succeeds. The function receives the response data (converted to a JavaScript object if the DataType was JSON), as well as the text status of the request and the raw request object.

    1. Success: function (result) {
    2. $(‘#result’).html(result);

    error A callback function to run if the request results in an error. The function receives the raw request object and the text status of the request.

    1. error: function (result) {
    2. alert(‘Error occured!!’);
    3. },

    Let’s Post Values using JQuey,Ajax: We often use the jQuery Ajax method in ASP.NET Razor Web Pages. Here is a sample code:

    Controller Action:

    1. [HttpPost]
    2. public ActionResult JqAJAX(Student st) {
    3. try {
    4. return Json(new {
    5. msg = “Successfully added ” + st.Name
    6. });
    7. } catch (Exception ex) {
    8. throw ex;

    Posting JSON JSON is a data interchange format where values are converted to a string. The recommended way to create JSON is include the JSON.stringify method. In this case we have defined:

    And the data type set to:

    And the content type set to application/json

    1. contentType: ‘application/json; charset=utf-8’

    Syntax: JSON.stringify(value[, replacer[, space]]) Post Script:

    1. var Student = {
    2. ID: ‘10001’,
    3. Name: ‘Shashangka’,
    4. Age: 31
    5. };
    6. $.ajax({
    7. type: “POST”,
    8. url: “/Home/JqAJAX”,
    9. data: JSON.stringify(Student),
    10. contentType: ‘application/json; charset=utf-8’,
    11. success: function(data) {
    12. alert(data.msg);
    13. },
    14. error: function() {
    15. alert(“Error occured!!”)
    16. });

    Controller Action:

    1. [HttpPost]
    2. public ActionResult JqAJAX(Student st) {
    3. try {
    4. return Json(new {
    5. msg = “Successfully added ” + st.Name
    6. });
    7. } catch (Exception ex) {
    8. throw ex;

    JSON Response Result: Sent data format: {“ID”:”10001″,”Name”:”Shashangka”,”Age”:31} Received Data format: {“msg”:”Successfully added Shashangka”} Let’s Post JavaScript Objects: To send JavaScript Objects we need to omit the JSON.stringify(Student) method and we need to pass the plain object to the data option. In this case we have defined:

    And the datatype set to:

    And the content type set to default.

    1. contentType: ‘application/x-www-form-urlencoded’

    Post Script:

    1. var Student = {
    2. ID: ‘10001’,
    3. Name: ‘Shashangka’,
    4. Age: 31
    5. };
    6. $.ajax({
    7. type: “POST”,
    8. url: “/Home/JqAJAX”,
    9. data: Student,
    10. contentType: ‘application/x-www-form-urlencoded’,
    11. datatype: “html”,
    12. success: function(data) {
    13. alert(data.msg);
    14. },
    15. error: function() {
    16. alert(“Error occured!!”)
    17. });

    Controller Action:

    1. [HttpPost]
    2. public ActionResult JqAJAX(Student st) {
    3. try {
    4. return Json(new {
    5. msg = “Successfully added ” + st.Name
    6. });
    7. } catch (Exception ex) {
    8. throw ex;

    JavaScript Objects Response Result: Sent data format: ID=10001&Name=Shashangka&Age=31 Received Data format: {“msg”:”Successfully added Shashangka”} Let’s Post JavaScript Arrays: To send Array we need to omit the JSON.stringify(Student) method and we need to pass the plain object to the data option. In this case we have defined:

    And the datatype set to:

    And the content type set to default

    1. contentType: ‘application/x-www-form-urlencoded’

    Post Script:

    1. var ID = [“Shashangka”, “Shekhar”, “Mandal”];
    2. $.ajax({
    3. type: “POST”,
    4. url: “/Home/JqAJAX”,
    5. data: {
    6. values: ID
    7. },
    8. datatype: “html”,
    9. contentType: ‘application/x-www-form-urlencoded’,
    10. success: function(data) {
    11. alert(data.msg);
    12. },
    13. error: function() {
    14. alert(“Error occured!!”)
    15. });

    Controller Action:

    1. [HttpPost]
    2. public ActionResult JqAJAX(string[] values) {
    3. try {
    4. return Json(new {
    5. msg = String.Format(“Fist Name: {0}”, values[0])
    6. });
    7. } catch (Exception ex) {
    8. throw ex;

    Array Response Result: Sent data format: values[]=Shashangka&values[]=Shekhar&values[]=Mandal Received Data format: {“msg”:”Fist Name: Shashangka”} Hope this will help to understand different datatypes and Ajax posting. Thanks!

    In this article I will explain with an example, how to call Controller with GET call using jQuery AJAX in ASP.Net MVC.

    Model

    Following is a Model class named PersonModel with two properties i.e. Name and DateTime.

    public class PersonModel

    ///

    /// Gets or sets Name.

    ///

    public string Name { get; set; }

    ///

    /// Gets or sets DateTime.

    ///

    public string DateTime { get; set; }

    Controller

    The Controller consists of two Action methods.

    Action method for handling GET operation

    Inside this Action method, simply the View is returned.

    Action method for handling jQuery AJAX operation

    This Action method handles the GET call made from the jQuery AJAX function from the View.

    Note: By default, ASP.Net MVC does not allow JSON GET call and hence it needs to be explicitly allowed using the JsonRequestBehavior.AllowGet behavior.

    The value of the name parameter is assigned to the Name property of the PersonModel object along with the Current DateTime and finally the PersonModel object is returned back as JSON to the jQuery AJAX function.

    public class HomeController : Controller

    // GET: Home

    public ActionResult Index()

    return View();

    [HttpGet]

    public JsonResult AjaxMethod(string name)

    PersonModel person = new PersonModel

    Name = name,

    DateTime = DateTime.Now.ToString()

    };

    return Json(person, JsonRequestBehavior.AllowGet);

    Typical GET call using jQuery AJAX

    The following figure describes a jQuery AJAX call in ASP.Net MVC.

    View

    Next step is to add a View for the Controller and while adding you will need to select the PersonModel class created earlier.

    Inside the View, in the very first line the PersonModel class is declared as Model for the View.

    The View consists of an HTML TextBox element and a Button.

    The Button has been assigned a jQuery click event handler and when the Button is clicked a jQuery AJAX called is made to the Controller’s action method.
    The TYPE is set to GET and the URL for the jQuery AJAX call is set to the Controller’s action method i.e. /Home/AjaxMethod.

    The value of the TextBox is passed as parameter and the returned response is displayed using JavaScript Alert Message Box.

    @model jQuery_AJAX_GET_MVC.Models.PersonModel

    @{

    Layout = null;

    <br /> Index<br />

    Screenshot

    Downloads

    What is Ajax?

    As we all know, AJAX means Asynchronous JavaScript and XML. It is a client-side script that communicates to and from a server/database without the need for a postback or a complete page refresh. The Ajax speeds up response time.

    In other words, Ajax is the method of exchanging data with a server, and updating parts of a web page, without reloading the entire page.

    ASP.NET CORE : Call Controller Action Method using JQuery AJAX
    ASP.NET CORE : Call Controller Action Method using JQuery AJAX

    C-Sharpcorner Member List

Now, press F5 to execute the project.

You will encounter the following errors in Developer Tools.

ERROR 1

  1. OPTIONS http://localhost:52044/api/member 405 (Method Not Allowed).
  2. Response to the preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:50702’ is therefore not allowed access.

To remove the above errors, the Web.Config file needs to be updated.

Update Web.Config file of your WebAPI Project with the following codes.

Now, press F5 to execute the project again.

ERROR 2

  1. OPTIONS http://localhost:52044/api/member 405 (Method Not Allowed)
  1. Failed to load http://localhost:52044/api/member: Response for preflight does not have HTTP ok status.

To remove the above errors, the Global.asax.cs file needs to be updated. Update the Global.asax.cs file of your WebAPI Project with the following codes.

  1. protected void Application_BeginRequest()
  2. if (Request.Headers.AllKeys.Contains(“Origin”) && Request.HttpMethod == “OPTIONS”)
  3. Response.End();
  4. Response.Flush();

Now, you can see the developer tools in the output screen. You will get the perfect output in console log.

Now, you can see on the browser that your browser is ready with the following output.

OUTPUT

html


html


head


title


jQuery ajax() Method




title


script


src




script


script


$(document).ready(function () {


$("li:parent").css("background-color", "green");


});




script




head


body


style


"text-align:center;"


h1


style


"color:green"


GeeksForGeeks




h1


h2


jQuery ajax() Method




h2


h3


id


"h11"


>


h3


button


>Click


button


script


$(document).ready(function () {


$("button").click(function () {


$.ajax({


url: "geeks.txt",


success: function (result) {


$("#h11").html(result);


});


});


});




script




body




html

geeks.txt

“hello geeks !”

Output:

Example 2: This example illustrates the ajax() method in jQuery.

ASP.NET MVC -  #28: Cách gọi AJAX trong ASP.NET MVC | AJAX call in ASP.NET MVC | TEDU
ASP.NET MVC – #28: Cách gọi AJAX trong ASP.NET MVC | AJAX call in ASP.NET MVC | TEDU

Benefits of Ajax

  • Callbacks
  • Making Asynchronous Calls
  • User-Friendly
  • Improve the speed, performance and usability of a web application

Implementation of Ajax can be done in two way in ASP.Net Application

  • using Update Panel and,
  • using jQuery

What Advances have Been Made to Ajax?

JavaScript is the client-side scripting language and XML is a mark-up language to define data. And we have, JSON(JavaScript Object Notation) as another mark-up language to define data as well. JSON is much easier to use with JavaScript than XML. After the combination of JavaScript and Ajax, the XML Web Services are being replaced by JSON Web Services.

Another major advance to JavaScript and Ajax is the JavaScript object library called jQuery, which is the free, open-source software. It is a wrapper for JavaScript. jQuery is used to write the JavaScript to navigate and manipulate a page and make asynchronous Ajax callbacks.

Hence, Ajax callbacks have become standard programming practices by using jQuery and JSON Web Services for designing and developing web applications.

html


html


head


title


>jQuery ajax() Method


title


script


src




script




head


body


style


"text-align: center;"


h1


style


"color: green;"


GeeksForGeeks




h1


h2


>jQuery ajax() Method


h2


h3


id


"h11"


>


h3


button


>Click


button


script


$(document).ready(function () {


$("button").click(function () {


$.ajax({


url: "geeks.txt",


success: function (result) {


$("#h11").html(result);


},


error: function (xhr, status, error) {


console.log(error);


});


});


});




script




body




html

geeks.txt

GeeksforGeeks,A Computer Science Portal for all Geeks.

Output:

jQuery is an open source JavaScript library that simplifies the interactions between an HTML/CSS document, It is widely famous with it’s philosophy of “Write less, do more”. You can learn jQuery from the ground up by following this jQuery Tutorial and jQuery Examples.

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!

Last Updated :
14 Dec, 2023

Like Article

Save Article

Share your thoughts in the comments

Please Login to comment…

Ajax Calls in MVC using jQuery
Ajax Calls in MVC using jQuery

Sử dụng jQuery Ajax trong ASP.NET MVC

Sử dụng jQuery Ajax trong ASP.NET MVC

Trong bài viết này hướng dẫn sử dụng jQuery ajax với các phương thức Action sử dụng http verbs tương ứng.

Địa chỉ URL trong jQuery Ajax


public JsonResult UrlResponse() //truy cập sử dụng Url { return Json(new { Name = "UrlResponse", Response = "Response from Get", Date = DateTime.Now.ToString("dd/MM/yyyy hh:mm:ss tt") }, JsonRequestBehavior.AllowGet); }

Loại giao thức trong jQuery Ajax


[HttpGet] public JsonResult TypedResponse() //Lỗi nếu truy cập sử dụng Url { return Json(new { Name = "TypedResponse", Response = "Response from Get", Date = DateTime.Now.ToString("dd/MM/yyyy hh:mm:ss tt") }, JsonRequestBehavior.AllowGet); }

Bây giờ chúng ta sẽ bắt đầu sử dụng phương thức action trong MVC, và sử dụng JQuery Ajax gọi $.ajax.
Một số thành phần trong cách gọi ajax

1. Xác định phương thức action trong MVC được gọi trong Ajax.Thuộc tính url trong $.ajax xác định controller và action trong MVC, theo định dạng /{controller}/{action}

Ví dụ:


url: ‘/User/Create’ url: ‘/User/Get/20’

Hoặc có thể sử dụng phương thức Url.Action để xác định controller và action.


url: ‘@Url.Action(“User”,”Create”)’

2. Xác định http verb sử dụng trong Ajax.Thuộc tính type với các giá trị ‘GET/ POST/ PUT/ DELETE’ sử dụng trong Ajax tương ứng với HttpVerbs trong phương thức action MVC.

Ví dụ:

Type : “POST”

3. Xác định tham số nếu phương thức action trong MVC có sử dụng tham số.

Thuộc tính data xác định dữ liệu được truyền cho tham số trong phương thức action.

Ví dụ:


data: JSON.stringify({ user: { name: ‘Rintu’, email: ‘[email protected]’ } }), data: { name: ‘Rintu’, email: ‘[email protected]’ },

4. Nhận dữ liệu trả về sau khi thực hiện thành công.

Thuộc tính success xác định hàm nhận dữ liệu trả về.

Ví dụ:


success: function (data) { alert(data); },

5. Nếu xảy ra lỗi, thuộc tính error xác định hàm nhận lỗi trả về.

Ví dụ:


error: function (xhr) { alert(‘error’); }

Truyền tham số cơ bản từ jQuery ajax đến phương thức action MVC

Trong UserController MVC chứa phương thức action:


[HttpGet] public JsonResult Get(int id) { return Json("Response from Get", JsonRequestBehavior.AllowGet); }

Cách gọi phương thức action Get trong ajax:


$.ajax({ url: '@Url.Action(“User”,”Get”), dataType: "json", type: "GET", contentType: 'application/json; charset=utf-8', data: {id:1}, async: true, processData: false, cache: false, success: function (data) { alert(data); }, error: function (xhr) { alert('error'); } });

Truyền tham số là đối tượng json từ jQuery ajax đến phương thức action MVC

Phương thức action Create trong UserController nhận đối tượng user làm tham số.


// POST: /User/Create [HttpPost] public JsonResult Create(User user) { return Json("Response from Create"); }

Cách gọi trong jQuery ajax.

Tạo dữ liệu kiểu json trong ajax để truyền cho phương thức Create trong MVC.


/*POST*/ $.ajax({ url: '@Url("User","Create"), dataType: "json", type: "POST", contentType: 'application/json; charset=utf-8', data: JSON.stringify({ user: { name: 'Rintu', email: '[email protected]' } }), async: true, processData: false, cache: false, success: function (data) { alert(data); }, error: function (xhr) { alert('error'); } })

Truyền tham số phức hợp từ jQuery ajax đến phương thức action MVC

Phương thức action Edit trong UserController nhận 2 tham sô: id và đối tượng user.


[HttpPost] public JsonResult Edit(int id, User user) { return Json("Response from Edit"); }

Cách gọi phương thức action Edit trong jQuery ajax.


$.ajax({ url: '/User/Edit', dataType: "json", type: "POST", contentType: 'application/json; charset=utf-8', data: JSON.stringify({ id: 100, user: {name: 'Rintu', email: '[email protected]'} }), async: true, processData: false, cache: false, success: function (data) { alert(data); }, error: function (xhr) { alert('error'); } });


Bạn đang muốn tìm kiếm 1 công việc với mức thu nhập cao.

✅ Hoặc là bạn đang muốn chuyển đổi công việc mà chưa biết theo học ngành nghề gì cho tốt.✅ Giới thiệu với bạn Chương trình đào tạo nhân sự dài hạn trong 12 tháng với những điều đặc biệt mà chỉ có tại IMIC và đây cũng chính là sự lựa chọn phù hợp nhất dành cho bạn:👉 Thứ nhất: Học viên được đào tạo bài bản kỹ năng, kiến thức chuyên môn lý thuyết, thực hành, thực chiến nhiều dự án và chia sẻ những kinh nghiệm thực tế từ Chuyên gia có nhiều năm kinh nghiệm dự án cũng như tâm huyết truyền nghề.👉 Thứ hai: Được ký hợp đồng cam kết chất lượng đào tạo cũng như mức lương sau tốt nghiệp và đi làm tại các đối tác tuyển dụng của IMIC. Trả lại học phí nếu không đúng những gì đã ký kết.👉 Thứ ba: Cam kết hỗ trợ giới thiệu công việc sang đối tác tuyển dụng trong vòng 10 năm liên tục.👉 Thứ tư: Được hỗ trợ tài chính với mức lãi suất 0 đồng qua ngân hàng VIB Bank.👉 Có 4 Chương trình đào tạo nhân sự dài hạn dành cho bạn lựa chọn theo học. Gồm có:1) Data Scientist full-stack2) Embedded System & IoT development full-stack3) Game development full-stack4) Web development full-stack✅ Cảm ơn bạn đã dành thời gian lắng nghe những chia sẻ của mình. Và tuyệt vời hơn nữa nếu IMIC được góp phần vào sự thành công của bạn.✅ Hãy liên hệ ngay với Phòng tư vấn tuyển sinh để được hỗ trợ về thủ tục nhập học.✅ Chúc bạn luôn có nhiều sức khỏe và thành công!

On my MVC View I have button:

When I click this button I need call one Action, do some stuff there and then Submit my form.

I have this jQuery:


$('#btnSave').click(function () { $.ajax({ url: "/Home/SaveDetailedInfo", type: "POST", data: JSON.stringify({ 'Options': someData}), dataType: "json", traditional: true, contentType: "application/json; charset=utf-8", success: function (data) { if (data.status == "Success") { alert("Done"); } else { alert("Error occurs on the Database level!"); } }, error: function () { alert("An error has occured!!!"); } }); });

Then I want to submit my form. In Controller I have 2 Actions:


public ActionResult SaveDetailedInfo(Option[] Options) { return Json(new { status = "Success", message = "Success" }); } [HttpPost] public ActionResult Save() { return RedirectToAction("Index", "Home"); }

The problem is when I have

type="submit"

in my button, I can’t reach

SaveDetailedInfo

Action, cause ajax gives me

error

, but when I remove

type="submit"

, ajax works fine, but

Save

Action never executes.

Please, any ideas how to execute both Actions? I thought maybe after

Ajax > Success

try to add

type=submit

through jquery and use

.click()

, but it sounds strange to me.

Keywords searched by users: ajax call in jquery mvc

Categories: Cập nhật 35 Ajax Call In Jquery Mvc

How To Use Ajax And Jquery In Spring Web Mvc (.Jsp) Application • Crunchify
How To Use Ajax And Jquery In Spring Web Mvc (.Jsp) Application • Crunchify
Hectorcorrea.Com
Hectorcorrea.Com
Jquery Ajax Call To Mvc Controller With Parameters - Sensible Dev
Jquery Ajax Call To Mvc Controller With Parameters – Sensible Dev
Showing Data Using Jquery Ajax Call Json In Asp.Net Mvc
Showing Data Using Jquery Ajax Call Json In Asp.Net Mvc
Asp.Net Core Mvc Ajax Form Requests Using Jquery-Unobtrusive | Software  Engineering
Asp.Net Core Mvc Ajax Form Requests Using Jquery-Unobtrusive | Software Engineering
Getting Started With Jquery $.Ajax() – Back To Basics | Dotnetcurry
Getting Started With Jquery $.Ajax() – Back To Basics | Dotnetcurry
Ajax Calls To .Net5 Mvc Controllers (Using Jquery) - Youtube
Ajax Calls To .Net5 Mvc Controllers (Using Jquery) – Youtube
Github - Geeksarray/Jquery-Ajax-Call-With-Jsonresult-In-Asp-Net-Mvc: This  Article Gives You Details About How You Can Implement Jquery Ajax Calls To Asp.Net  Mvc Controller And Display Jsonresult On View.
Github – Geeksarray/Jquery-Ajax-Call-With-Jsonresult-In-Asp-Net-Mvc: This Article Gives You Details About How You Can Implement Jquery Ajax Calls To Asp.Net Mvc Controller And Display Jsonresult On View.
Asp.Net Mvc: Ajax Dialog Form Using Jquery Ui | Nick Olsen'S Programming  Tips
Asp.Net Mvc: Ajax Dialog Form Using Jquery Ui | Nick Olsen’S Programming Tips
Post Form Data To Controller In Asp.Net Mvc Using Ajax - Dotnetxp
Post Form Data To Controller In Asp.Net Mvc Using Ajax – Dotnetxp
Jquery Ajax Json Example In Asp.Net To Insert Data Into Sql Server Database  Without Postback ~ Asp.Net,C#.Net,Vb.Net,Mvc,Jquery,Javascipt,Ajax,Wcf,Sql  Server Example
Jquery Ajax Json Example In Asp.Net To Insert Data Into Sql Server Database Without Postback ~ Asp.Net,C#.Net,Vb.Net,Mvc,Jquery,Javascipt,Ajax,Wcf,Sql Server Example
Ajax And Jquery In Asp.Net Mvc | Chsakell'S Blog
Ajax And Jquery In Asp.Net Mvc | Chsakell’S Blog
Posting Javascript Types To Mvc 6 In .Net Core, Using Ajax | I Came, I  Learned, I Blogged
Posting Javascript Types To Mvc 6 In .Net Core, Using Ajax | I Came, I Learned, I Blogged
Asp.Net Mvc - Loading Partial Views Using Ajax/Jquery - Youtube
Asp.Net Mvc – Loading Partial Views Using Ajax/Jquery – Youtube
Sử Dụng Jquery Ajax Trong Asp.Net Mvc
Sử Dụng Jquery Ajax Trong Asp.Net Mvc
Problem Passing A Record Size From Ajax To Controller In Asp Net Core 5 Mvc  - Microsoft Q&A
Problem Passing A Record Size From Ajax To Controller In Asp Net Core 5 Mvc – Microsoft Q&A
Jquery Ajax To Bind Asp.Net Dropdownlist Dynamically From Sql Server  Database ~ Asp.Net,C#.Net,Vb.Net,Mvc,Jquery,Javascipt,Ajax,Wcf,Sql Server  Example
Jquery Ajax To Bind Asp.Net Dropdownlist Dynamically From Sql Server Database ~ Asp.Net,C#.Net,Vb.Net,Mvc,Jquery,Javascipt,Ajax,Wcf,Sql Server Example
Ajax And Jquery In Asp.Net Mvc | Chsakell'S Blog
Ajax And Jquery In Asp.Net Mvc | Chsakell’S Blog
Grid View For Aps.Net Mvc - How To Use The Jquery.Ajax Function With  Devexpress Mvc Extensions | Devexpress Support
Grid View For Aps.Net Mvc – How To Use The Jquery.Ajax Function With Devexpress Mvc Extensions | Devexpress Support

See more here: kientrucannam.vn

See more: https://kientrucannam.vn/vn/

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *