必须有一些我想念的东西。我已经尝试使用jquery将数据发送到控制器,但它没有命中控制器jsonresult removeline() [英] There's got to be something I'm missing. I've tried using jquery to send data to controller but it do not hit to controller jsonresult removeline ()

查看:89
本文介绍了必须有一些我想念的东西。我已经尝试使用jquery将数据发送到控制器,但它没有命中控制器jsonresult removeline()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试向控制器发送数据并使用$ .post(url {String:string} fucnction(){})方法返回allowGet,但是没有获得成功,jqury没有在控制器中点击url

请帮帮我。



我的尝试:



jquery code





i am trying to send data to controller and return back allowGet using $.post(url {String:string } fucnction(){}) method , But not get success ,jqury did not hit url in controller
please help me .

What I have tried:

jquery code


$(document).ready(function () {
    $('#orderdetailsItems').on('click', '.remove', function () {
            var isAllValid = "";
            var $Srrmv = $(this).closest("tr").find(".sr") .val();   
            if ($Srrmv == "0") {
                isAllValid = false
                alert("not Get")
            }
            else {
                isAllValid = true;
            }
            if (isAllValid) {
                var $tot = $(this).closest("tr") .find(".Total").val();
                var Pnet = $("#NetTotal").val();
                var n_result1 = "";
                if ($tot !== "" && $.isNumeric($tot) && $.isNumeric(Pnet)) {
                    n_result1 = parseFloat(Pnet) - parseFloat($tot);
                }
                var URL = "/Credit/Removeline";
                var Srno = $(this).closest("tr").find(".sr").val().trim();
               
                if (Srno != null) {
                    alert(Srnor + "Post Methode") 
                     // he show this alert msg then no response//

                    $.post(URL, { Srno: Srno }, function (data) {
                         $(this).parents('tr').remove();
                       alert("Srno" + $Srrmv + "    REMOVE SUCCESSFULLY ");
                    });
                }

               
            }
    });
});




信用卡控制器






in a Credit controller

[HttpPost]
        public JsonResult Removeline(Dport pd, int Srno, int PerTranCode) {

            var rmv = dc.PerchesDetails.Where(m => m.PerTranCode == PerTranCode).ToList();
             
            return Json(pd, JsonRequestBehavior.AllowGet);
        }

推荐答案

.post(url {String:string} fucnction(){})方法,但不能获得成功,jqury没有打到控制器的网址

请帮帮我。



我尝试过的事情:



jquery code





.post(url {String:string } fucnction(){}) method , But not get success ,jqury did not hit url in controller
please help me .

What I have tried:

jquery code



(document).ready(function(){
(document).ready(function () {


('#orderdetailsItems')。on('click','。remove',function(){
var isAllValid =;
var
('#orderdetailsItems').on('click', '.remove', function () { var isAllValid = ""; var


这篇关于必须有一些我想念的东西。我已经尝试使用jquery将数据发送到控制器,但它没有命中控制器jsonresult removeline()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆