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 7877075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:16:31+00:00 2026-06-03T03:16:31+00:00

I would like to provide my Action with an array of integer values (based

  • 0

I would like to provide my Action with an array of integer values (based on selected checkbox values on a form). I am trying to use Ajax.ActionLink as follows…

    <%= Ajax.ActionLink("Submit", "PrintPinLetters", "EPOC", new { selectedItemsToPrint }, new AjaxOptions { HttpMethod="POST", UpdateTargetId = "PrintConfirmation", LoadingElementId = "resultLoadingDiv", OnFailure="handleError"}, new { id = "btnPrintPinLetter" }) %>                            

but am not sure what to pass into the routeValue section. My Action in the controller is defined as…

    [HttpPost]
    public ActionResult PrintPinLetters(Int64[] selectedItemsToPrint)
    {                           

Basically I am looking to pass an array (or comma separated list of ID values) in the ‘selectedItemsToPrint’. This list would be build using the values defined by checkboxes (all named the same) in multiple rows of a table.

I have used Ajax.BeginForm but as this results in a nested form I was having unpredictable results when using older browsers (IE 7 and 8).

  • 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-03T03:16:32+00:00Added an answer on June 3, 2026 at 3:16 am

    normally i would do the ajax myself with a jQuery call. You would set it up like this

    1. instead of using Ajax.ActionLink(), use Html.ActionLink(…. {id = “myid”}). Dont forget to give your link an id
    2. create an onready function

      $(document).ready(function () {
          $('#myid').click(function() {
              var allElements = $('#container').find('input').serialize();  
              $.post(action, allElements, function (data) {
                  // add your code here to process the data returned from the post.
              });
      
              return false;  // dont post the form
          });
      });
      
    3. dont forget to set the name attribute of all of the input elements to selectedItemsToPrint so the binding will work correctly with your actionresult

    The Html should look something like this

    <div id="container">
        <input type="checkbox" name="selectedItemsToPrint" value="somevalue0" />
        <input type="checkbox" name="selectedItemsToPrint" value="somevalue1" />
        <input type="checkbox" name="selectedItemsToPrint" value="somevalue2" />
        <input type="checkbox" name="selectedItemsToPrint" value="somevalue3" />
        <input type="checkbox" name="selectedItemsToPrint" value="somevalue4" />
        <input type="checkbox" name="selectedItemsToPrint" value="somevalue5" />
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a set of C++ libraries and now I would like provide a
I would like to provide the same content inside 2 different base files. So,
I would like to provide a PHP hanging request that will stay open until
I would like to provide a facade class to the existing AmazonS3Client (say MyAmazonS3Client),
I would like to provide localization for my website in Azure. I went with
I'm building a plugin assembly and I would like to provide an accompanying config
I am writing and publishing my apps on android and would like to provide
I would like to know how to provide a Ruby application with a REST
I would like to know how to provide a formatting capabilities that enable the
I would like to display an image on my web page and provide the

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.