I have an ActionMethod
[HttpGet]
[Route("ControllerName/IsUniqueNotificationName/{notificationName}")]
public IActionResult IsUniqueNotificationName(string notificationName)
{
var name = string.IsNullOrEmpty(notificationName);
var isUnique =
this.bannerNotificationService.IsUniqueNotificationName(notificationName);
return this.Json(isUnique);
}
my javascript method
checkUniqueNotificationname = function (emailElement) {
var notificationName = $(emailElement).val();
let uri = "BannerNotification/IsUniqueNotificationName/" + notificationName;
$.ajax({
type: "Get",
url: common.buildUrlWithBasePath(uri),
success: function (data) {
if (data == true) {
$("#BannerNotificationName").css({ "border-color": "black" });
$("#altFromMessageGroupValue").hide();
}
else {
$("#BannerNotificationName").css({ "border-color": "red" });
$("#altFromMessageGroupValue").show();
}
},
error: function () {
common.hideLoader();
}
});
};
when I get notificationName value then its hitting my ActionMethod but when I get notificationName as empty strings**(i.e; notificationName='')** its not hitting my endpoint. Instead, its hitting another endpoint which looks like
[Route("ControllerName/{banName}")]
[HttpGet]
public IActionResult Details(string banName)
{
}
Could someone help me with this issuw
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…