سلام دوستان
@Ajax.ActionLink("حذف", "Delete", @item.Id, new AjaxOptions { Confirm = "آیا مطمئن هستید؟", HttpMethod = "Post",OnSuccess="Deleted"})
از این استفاده میکنم برای ارسال مقادیر به اکشن Delete ولی مقادیر به اکشن ارسال نمیشه و اکشن فراخونی نمیشه
اینم اکشنم
[HttpPost]
public ActionResult Delete(int Id)
{
var mydata = new { id = -1 };
if (Request.IsAjaxRequest())
{
Models.BLStudents blstudent = new Models.BLStudents();
if (blstudent.Delete(Id))
{
mydata = new { id = Id };
}
}
else
{
RedirectToAction("List");
}
retu Json(mydata, JsonRequestBehavior.DenyGet);
}
اینم قسمت Bundle های پروژه
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
"~/Scripts/jquery-ui-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/unobtrusive").Include(
"~/Scripts/jquery.unobtrusive*"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.unobtrusive*",
"~/Scripts/jquery.validate*"));// Use the development version of Modeizr to develop with and lea from. Then, when you're
// ready for production, use the build tool at http://modeizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modeizr").Include(
"~/Scripts/modeizr-*"));
لطفا اگه کسی میدونه راهنمایی کنه
برچسب:
نویسنده: محمد رضا جوادیان