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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:08:50+00:00 2026-06-08T09:08:50+00:00

I have a form that use a control with the attribute multiple=multitple. This allow

  • 0

I have a form that use a control with the attribute multiple=”multitple”. This allow the user to select more than one item in the control.

When the form is submitted with the get method the url of the requested page contains one multiples parameters with the same name. One for each item selected. For exemple, I could get something like this :

/logs?levels=DEBUG&levels=INFO&levels=FATAL

In my controller the action correctly receive the values in a parameters of type List like this :

public ActionResult Index(List<String> levels)
{
   ...
}

Now, for some reason I need to create a link to this action that will include more than one values for the levels parameter. How can I use Html.ActionLink to create such a link? I tried it this way :

@Html.ActionLink((p + 1).ToString(), "Index", new {
    levels = ViewBag.selectedLevels_AS_A_GENERIC_LIST_OF_STRINGS,
    itemsPerPage = ViewBag.itemsPerPage
});

It does not work, because the list is not expanded in any way, instead .ToString() is called on it and the result is inserted into the link. Of course, there is no way for me to create an object with multiples properties named “levels” either.

How can I create an ActionLink like the one generated by the form I use?

Thanks

  • 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-08T09:08:51+00:00Added an answer on June 8, 2026 at 9:08 am

    Something like this should work.

    @Html.ActionLink((p + 1).ToString(), "Index", new RouteValueDictionary{
        {"levels[0]", selectedLevels_AS_A_GENERIC_LIST_OF_STRINGS[0]},
        {"levels[1]", selectedLevels_AS_A_GENERIC_LIST_OF_STRINGS[1]},
        {"itemsPerPage", ViewBag.itemsPerPage}
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an C# form application that use an access database. This application works
I have a user form that is working perfectly. The page makes use of
I have a form on a page that a user can use to create
I have a page which displays a form that a logged-in user can use
i have a user control that descends from UserControl. When dropped onto the form
So I have an unbound form that I use to save data to a
I have two radio buttons on my MVC form that I use to hide
I have a small jQuery plugin that I use for form AJAX validation. There
I have an In-house windows form app that I would like to use Spell
I have a create action in the controller that I use for a form

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.