Click here to Skip to main content
15,893,190 members

Comments by SijoXavier (Top 4 by date)

SijoXavier 1-Apr-18 6:30am View    
Here is my sample code which shows the same behavior

Index.cshtml


<!DOCTYPE html>


<title>Index






Load1



Load2


Clear


$('#btnLoad1').click(function () {
$('#lbl1').html('Loading.....');
$.ajax({
async:true,
url: "/Home/Load1",
type: "Get",
dataType: "html",
contentType: "application/json; charset=utf-8",
success: function (data) {

$('#lbl1').html(data);

},
error: function () {
alert("An error has occured!!!");
}
});
});


$('#btnLoad2').click(function () {
debugger;
$.ajax({
async:true,
url: "/Home/Load2",
type: "Get",
dataType: "html",
contentType: "application/json; charset=utf-8",
success: function (data) {

$('#lbl2').html(data);

},
error: function () {
alert("An error has occured!!!");
}
});
});

$('#btnClear').click(function()
{
$('#lbl1').text('');
$('#lbl2').text('');
}
);




Server side:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace AjaxMultipleRequest.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
return View ();
}

[HttpGet]
public ActionResult Load1()
{
System.Threading.Thread.Sleep(10000);
return Content("Loaded data set 1");
}

[HttpGet]
public ActionResult Load2()
{
return Content("Loaded data set 2");
}

}
}
SijoXavier 1-Nov-17 6:34am View    
Oh my bad ,Thanks a lot Maciej,will try for an external sql server for lunux option
SijoXavier 31-Oct-17 5:25am View    
Local db inside visual studio
SijoXavier 31-Oct-17 5:16am View    
Hi Maciej,thank you for your response,I was actually referring to the Visual studio 2017 for Mac not the visual studio Code.