I communicate between Back and Front End with Ajax, but I don't know how to encrypt the data. This is a method of my controller that returns a Json
[HttpGet]
[Route("/activities/FindWmsActivityId/{ActivityId}")]
public IActionResult FindWmsActivityId(int ActivityId)
{
var wmsactivity= new wmsactivity();
wmsactivity = _wmsactivityRepository.FindId(ActivityId);
if (wmsactivity== null)
return Json(new { validation = "wmsactivity not found" });
return Json(wmsactivity);
}
This is my front end method for controller method call
{
type: 'GET',
url: '/activities/FindWmsActivityId/1',
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
success: function (data)
{
if (data!= null)
return = data;
},
error: function ()
{
MessageTextDanger('Error')
}
});
The code is working, but when inspecting, you can see the content inside the Json file, and I need to encrypt this data.