I have a controller which contains two Post method, But whenever I make ajax request it is taking me to the first post method in the controller, instead I want to go to the second one, how do I route it to the second Post method? This is the code I have so far, It works fine but only takes me to the first POST method, I am not sure on how to use my url in ajax ( may be that is causing the problem).
var ajax = Ext.Ajax.request({
url: './../ImportCSVFile',
data: details,
method: 'POST',
headers: { 'accept': '*/*' },
success: function (response, options) {
var result = JSON.parse(response.responseText);
if (mask) {
mask.destroy();
}
Ext.Msg.alert("File Upload Successful");
}
});
And here is my method in the controller that I want to reach:
[HttpPost]
public IActionResult ImportCSVFile(IFormFile formFile)
{
//sample of import file
}