localhostでは正常に動作していますが、デプロイ後は動作しません。ここで私はタイプを使用しています:私は、コントローラから削除するにjQueryを使用しています削除し、それでも取得し、POSTの何もajaxはリモート側では動作しませんが、mvc.netのlocalhostで動作します
$("#btnDelete").click(function (e) {
e.preventDefault();
//alert("delete button clicked");
bootbox.confirm("Do you really want to delete this User", function(result) {
if (result) {
$.ajax({
url: "User/DoDelete/"[email protected],
type:"Delete",
success: function() {
// bootbox.alert("USer "+ @Model.ID+" Deleted successFully");
window.location.href = '@Url.Action("Index","User")';
},
error:function() {
bootbox.alert("Error");
}
});
}
});
});
を働いていないし、私のコントローラは、それがなぜ私は理解できませんでした
[HttpDelete]
public ActionResult DoDelete(int id)
{
context = new Cost();
UserEmployee user = context.UserEmployees.Where(x => x.ID == id).FirstOrDefault();
if (user == null)
{
return HttpNotFound();
}
try
{
context.UserEmployees.Remove(user);
context.SaveChanges();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
return RedirectToAction("Index");
}
ですlocalhostでは動作しますが、デプロイ側では動作しません。
がASアプリの設定です解決以下のようにそれを書いて、どうもありがとうございましたIISまたは仮想ディレクトリ内のアプリケーション。そして、デフォルトWebサイトの直下にありますか? –
は、既定のWebサイトのIISでのアプリケーションとして –