Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Ajax async get function problem

Ajax async get function problem

Scheduled Pinned Locked Moved ASP.NET
questionhelp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    symeramon
    wrote on last edited by
    #1

    Please tell me what is the problem with this code???

    function VeriYaz(id) {
    $.ajax({
    type: 'GET',
    url: 'VeriAl.aspx',
    data: 'id=' + id,
    async: false,
    success: function (data) {
    var isim = data;
    this.form.elements["TextBox1"].value = isim.toString();
    }
    });
    }

    It doesnt even go to the given url... Yes it gets id succesfully but no data turning back... Thanks all...

    S J 2 Replies Last reply
    0
    • S symeramon

      Please tell me what is the problem with this code???

      function VeriYaz(id) {
      $.ajax({
      type: 'GET',
      url: 'VeriAl.aspx',
      data: 'id=' + id,
      async: false,
      success: function (data) {
      var isim = data;
      this.form.elements["TextBox1"].value = isim.toString();
      }
      });
      }

      It doesnt even go to the given url... Yes it gets id succesfully but no data turning back... Thanks all...

      S Offline
      S Offline
      symeramon
      wrote on last edited by
      #2

      So nobody knows why??? Would it be just because of the starting tag of asynx page?? :

      <%@ Page Language="C#" AutoEventWireup="true" CodeFile="VeriAl.aspx.cs" Inherits="Ads4WebClient.VeriAl" %>

      Cause it gives an error when I try to change CodeFile into CodeBehind??? And, I tried to open a new project to apply the code and see what happens, the asynx pages starting tag was like this:

      <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="VeriAl.aspx.cs" Inherits="WebApplication2.VeriAl" %>

      1 Reply Last reply
      0
      • S symeramon

        Please tell me what is the problem with this code???

        function VeriYaz(id) {
        $.ajax({
        type: 'GET',
        url: 'VeriAl.aspx',
        data: 'id=' + id,
        async: false,
        success: function (data) {
        var isim = data;
        this.form.elements["TextBox1"].value = isim.toString();
        }
        });
        }

        It doesnt even go to the given url... Yes it gets id succesfully but no data turning back... Thanks all...

        J Offline
        J Offline
        jkirkerx
        wrote on last edited by
        #3

        You have to post to a webservice .asmx or something similar $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "ws_SavedItems.asmx/update_SavedItems_ItemQty", data: "{\"qty_Value\" : " + secure_Qty + ", \"secure_CartID\" : " + secure_CartID + ", \"part_Number\" : \"" + part_Number + "\", \"secure_Token\" : \"" + secure_Token + "\"}", dataType: "json", success: function (responseText) { eval('(' + responseText.d + ')'); var obj = jQuery.parseJSON(responseText.d); result_Value = obj.result_value; qty_value = obj.qty_value; price_value = obj.price_value; totalPrice_value = obj.totalPrice_value; instantSavings_value = obj.instantSavings_value; masterImage_value = obj.masterImage_value; description_value = obj.description_value;

        S 1 Reply Last reply
        0
        • J jkirkerx

          You have to post to a webservice .asmx or something similar $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "ws_SavedItems.asmx/update_SavedItems_ItemQty", data: "{\"qty_Value\" : " + secure_Qty + ", \"secure_CartID\" : " + secure_CartID + ", \"part_Number\" : \"" + part_Number + "\", \"secure_Token\" : \"" + secure_Token + "\"}", dataType: "json", success: function (responseText) { eval('(' + responseText.d + ')'); var obj = jQuery.parseJSON(responseText.d); result_Value = obj.result_value; qty_value = obj.qty_value; price_value = obj.price_value; totalPrice_value = obj.totalPrice_value; instantSavings_value = obj.instantSavings_value; masterImage_value = obj.masterImage_value; description_value = obj.description_value;

          S Offline
          S Offline
          symeramon
          wrote on last edited by
          #4

          Thanks for your responde jkirkerx it is quite useful...

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups