Arshad Ali

Arshad Ali

  • NA
  • 636
  • 33.6k

How to compare value ajax nested function fetch from DB

Aug 6 2015 2:42 AM
Good Afternoon Sir ,
 
My problem is am create one web service in c# to GetProductId() am write simple query "select product_id from   products"
and sent to List<>. but my  JS code am use ajax function within ajax and how to compare nested ajax after success value from my productid.
Code is following :
 
<script type="text/javascript">
         function setSubmited() {
         if ($('.txtSubmited').val() == "")
         {
                     $('.txtSubmited').val("1"); blockUI();
                     $(function ()
                     {
                              var _id = $('#HFProductId').val();
                              var product_code = $('#txtItemCode').val();
                              var product_type = $('#ddlProductType').val();
                              var visible_individually = $('#checkVisble').val();
                              var obj = {_ID:_id, Product_code: product_code, Product_type: product_type, Visible_individually: visible_individually };
                             
                              $.ajax(
                              {
                                       type: "POST",
                                       contentType: "application/json; charset=utf-8",
                                       url: "EntryForm.aspx/insertData",
                                       data: JSON.stringify(obj),
                                       dataType: "json",
                                       success: function (data)
                                       {
                                                      // HOW TO COMPARE FETCH ID FROM DATABASE AND MY LOCAL ID IN THIS AJAX FUNCTION 
 
                                                 $.ajax({
                                                 type: "POST",
                                                 url: "EntryForm.aspx/GetData",
                                                 data: "{ }",
                                                 contentType: "application/json; charset=utf-8",
                                                 dataType: "json",
                                                success: function (response)
                                               {
                                               }
                                           });
                                      } 
 
   Please Replay as soon as possible.
   Thank You Sir......
 

Answers (6)