<script type= "Text/javascript" >
$ (function () {
Attach the link event handler
$ (this). Find ("a"). Click (function () {
var id = $ (this). attr ("id");
$ ("#addSuccess"). Hide ();
if (name!= "" &&name!= "undefined") {
if (name = = "True") {
$ ("#addSuccess"). Toggle (1000);
} else {
$ ("#addSuccess"). Hide ();
}
}
$ (". Link-delete"). Click (function () {
var id = $ (this). attr ("Data-id");
$ ("#deleteConfirm"). attr ("Data-id", id);
$ ("#modal-delete"). Modal ("show");
});
$ ("#deleteConfirm"). Click (function () {
var id = $ (this). attr ("Data-id");
Deleteschoolterm (ID);
});
function Deleteschoolterm (ID) {
var url = "@Url. Action (" Deleteschoolterm ")";
$.ajax ({
Url:url,
Type: "POST",
DataType: "JSON",
Data:JSON.stringify ({id:id}),
ContentType: "Application/json",
Error:function (JQXHR, Textstatus, Errorthrown) {
var errormsg = Json.parse (Jqxhr.responsetext);
$ ("#result"). HTML (Msghelper.alarm ("Error", Errormsg.message));
$ ("#result"). Show ("slow");
},
Success:function () {
Location.replace ("@Url. Action (" Index ")");
}
});
}