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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:20:44+00:00 2026-05-13T18:20:44+00:00

Our company is developing an API for our products and we are thinking about

  • 0

Our company is developing an API for our products and we are thinking about using ASP.NET MVC. While designing our API, we decided to use calls like the one below for the user to request information from the API in XML format:

http://ws.audioscrobbler.com/2.0/?method=artist.getimages&artist=cher&api_key=b25b959554ed76058ac220b7b2e0a026

As you can see, multiple parameters are passed (i.e. artist and api_key). In ASP.NET MVC, artist would be the controller, getImages the action, but how would I pass multiple parameters to the action?

Is this even possible using the format above?

  • 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-13T18:20:44+00:00Added an answer on May 13, 2026 at 6:20 pm

    Parameters are directly supported in MVC by simply adding parameters onto your action methods. Given an action like the following:

    public ActionResult GetImages(string artistName, string apiKey)
    

    MVC will auto-populate the parameters when given a URL like:

    /Artist/GetImages/?artistName=cher&apiKey=XXX
    

    One additional special case is parameters named “id”. Any parameter named ID can be put into the path rather than the querystring, so something like:

    public ActionResult GetImages(string id, string apiKey)
    

    would be populated correctly with a URL like the following:

    /Artist/GetImages/cher?apiKey=XXX
    

    In addition, if you have more complicated scenarios, you can customize the routing rules that MVC uses to locate an action. Your global.asax file contains routing rules that can be customized. By default the rule looks like this:

    routes.MapRoute(
                "Default",                                              // Route name
                "{controller}/{action}/{id}",                           // URL with parameters
                new { controller = "Home", action = "Index", id = "" }  // Parameter defaults
            );
    

    If you wanted to support a url like

    /Artist/GetImages/cher/api-key
    

    you could add a route like:

    routes.MapRoute(
                "ArtistImages",                                              // Route name
                "{controller}/{action}/{artistName}/{apikey}",                           // URL with parameters
                new { controller = "Home", action = "Index", artistName = "", apikey = "" }  // Parameter defaults
            );
    

    and a method like the first example above.

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

Sidebar

Related Questions

I'm developing an ASP .NET application, nothing fancy just another LOB App. Our company's
While aware of the appstore guidelines, specifically IAP usage. Our company is developing an
I'm developing an internal web app on our company intranet using PHP. One section
I've been tasked with developing an application for internal use in our company, the
The company I work for is developing an ASP.NET application that is used by
At our company we are developing an application that will consists of several modules.
I'm developing a TFS tool to assist the developers in our company. This said
I'm developing an Android app as a proof of concept for our company. If
So we have recently started developing applications for the iPad for our company. Unfortunately
I'm taxed with developing a custom e-commerce application for my company (using PHP/MySQL). 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.