Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4118358
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:57:01+00:00 2026-05-20T22:57:01+00:00

I am calling an ASP.NET Ajax method (e.g. a method tagged with [Ajax.AjaxMethod] )

  • 0

I am calling an ASP.NET Ajax method (e.g. a method tagged with [Ajax.AjaxMethod]) on a control which is dynamically created in JavaScript when the user clicks a link (basically it is inside a table, and when the link is clicked a tr/td is built out in JS code and added to the table). In the callback function I need to know what row is being called since I’m appending data to an input control in that row only; I have a hidden field that contains the total number of items added, but I cannot use this as it always adds to the last row (since it is incremented when a new row is added) not the row which is firing the function.

Something like the following:

// fieldName is a lookup string...
function loadOperators(fieldName) { 
    MyPage.LoadOperatorsFor(fieldName, loadOperators_Callback);
}

function loadOperators_Callback(response) { 
    var currentRow = // how to obtain this?

    // do other stuff here...
} 

I am also using jQuery but the methods are done in ASP.NET AJAX style as that’s the current style we use at work.

How am I able to determine the actual row which is firing the Ajax function, so I only populate the dropdown list contained in that row (I cannot rely on the user creating a row, and then populating that row; they might create say 5 rows and then go back to Row #2 and select something, so I would have to know they chose a value in Row #2 and not 3/4/5)? It doesn’t seem to be part of the response object, but the Callback function doesn’t seem to take any additional parameters.

The only thing I can think of doing would be to add it to my AjaxMethod so it would be passed back in the response, but this seems like a hack at best since I return a DataSet and the row number has no bearing on the data.

I forgot to add, I am not using the ASP.NET AJAX library, only jQuery and tagging methods with [Ajax.AjaxMethod]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T22:57:02+00:00Added an answer on May 20, 2026 at 10:57 pm

    For the record I was able to solve this by simply using an inline anonymous function so I can reference the lineNumber from the calling method, instead of passing a function reference. Simply and effective.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JavaScript function which redirect to Asp.net MVC action method. [AcceptVerbs(HttpVerbs.Post)] public
In a javascript file I'm calling an ASP.NET Ajax PageMethod (ASP.NET 3.5), correctly defined
Calling an asp.net mvc3 controller method which returns the results fine (list of an
I'm calling an asp.net webservice with JQuery and ajax, transfering data with json. I'm
I am trying to mock the Ajax.IsRequest() method of ASP.Net MVC. I found out
I'm calling a WebMethod (ASP.NET) via AJAX (jQuery). If I create a version of
i call my asp.net page method like below code $.ajax({ type: POST, url: MyPage.aspx/GetItems,
I am doing an AJAX call to a controller method on my ASP.Net MVC
How can I calling a webservice not written by me from asp.net ajax. What's
i am having a strange problem, while calling ajax jquery in asp.net.. i am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.