Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
3
Answers
Nested Ajax Function Call Webservice
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Arshad Ali
9y
371
1
Reply
Good After Noon Sir,
Sir i am created one webMethod to read data for the data reader and i call to ajax function but not received or get my product id form the data reader. code is following. i am try to call this webmethod Nested ajax function but not get output please help me.
Thanks you....
SqlConnection SqlConn = new SqlConnection(ConfigurationManager.ConnectionStrings["eLabSysCstr"].ToString());
SqlCommand ocmd = new SqlCommand("pr_get_products", SqlConn);
try
{
ocmd.CommandType = "select * from product";
ocmd.Connection.Open();
SqlDataReader odr = ocmd.ExecuteReader();
if (odr.Read())
{
txtItemCode.Text = odr["product_code"].ToString();
}
}
var _id = $('#HFProductId').val();;
$.ajax(
{
type: "POST",
contentType: "application/json; charset=utf-8",
url: "EntryForm.aspx/insertData",
data: {},
dataType: "json",
success: function (data)
{
function getid(prod_id)
{
$.ajax({
type: "POST",
url: "EntryForm.aspx/GetDetails",
data: "{ 'Product_Id': '" + prod_id + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response)
{
// BindTable(response.d);
console.log(prod_id);
},
failure: function (msg)
{
// alert(msg);
}
});
}
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
HTML and JAVASCRIPT BFS DFS code not working
How to compare value ajax nested function fetch from DB