I have one Area Named Test. Inside this area, I have script folder which contains JS file. I am making one ajax call from this js to the controller in a Root directory. This is not working. Ajax call returns 302 found and call Index method of that controller.
How can I make this working?
Structure of Area TeasArea -> Scripts -> test.js
$.ajax({
type: "POST",
url: url,
data: $form.serialize(),
dataType: "json",
traditional: true,
success: function (Res) {
value of url
is '/controllername/Methodname'
, where this controller
resides in Root directory's Controllers folder.
Note : I am generating this url using @Url.Action("MethodName", "ControllerName", new { area = "" });
Action Method in Controller looks like
public JsonResult sampleprint(FormCollection formData)
{
/// Code goes here.
}