Ajax async get function problem
-
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...
-
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...
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" %>
-
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...
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;
-
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;