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

  • SEARCH
  • Home
  • 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 8258519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:33:58+00:00 2026-06-08T02:33:58+00:00

I have a javascript method onRowSelected wchich gets rowid. How to pass the rowid

  • 0

I have a javascript method onRowSelected wchich gets rowid. How to pass the rowid in certain action of a controller with HttpGet?

function onRowSelected(rowid, status) {
        alert('This row has id: ' + rowid);
        //url: @Action.Url("Action","Controller")
        //post:"GET"
        // Something like this?
    }
  • 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-06-08T02:34:00+00:00Added an answer on June 8, 2026 at 2:34 am

    If your controller action expects an id query string parameter:

    var url = '@Url.Action("Action", "Controller")?id=' + rowid;
    

    or if you want to pass it as part of the route you could use replace:

    var url = '@Url.Action("Action", "Controller", new { id = "_id_" })'
        .replace('_id_', rowid);
    

    yet another possibility if you are going to send an AJAX request is to pass it as part of the POST body:

    $.ajax({
        url: '@Url.Action("Action", "Controller")',
        type: 'POST',
        data: { id: rowid },
        success: function(result) {
    
        }
    });
    

    or as a query string parameter if you are using GET:

    $.ajax({
        url: '@Url.Action("Action", "Controller")',
        type: 'GET',
        data: { id: rowid },
        success: function(result) {
    
        }
    });
    

    All those suppose that your controller action takes an id parameter of course:

    public ActionResult Action(string id)
    {
        ...
    }
    

    So as you can see many ways to achieve the same goal.

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

Sidebar

Related Questions

I have the following javascript method: function 123_test_function(){ } The function is generated by
I have a Javascript function that is called from the onchange method in a
I have a problem when call applet method from javascript.. I used this function
So I have a JavaScript method that is ran after a user selects certain
In my javascript method I have this: if (getInternetExplorerVersion() != '-1') { alert(IE!); Ice.Menu.showIt(targCompObject.offsetLeft
I have a simple javascript method to show an alert box. The method is
I have this javascript method: <script type=text/javascript> function MyFunction(sender, eventArgs) { if (someCondition) {
I would like to have a way to specify for certain Javascript method which
I have a javascript method looks like this JSMethod(JS_para_1,JS_para_2) { ...... ,,,,, } and
i have a javascript method that takes a date: convert(new Date(02/20/2010); how can i

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.