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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:31:02+00:00 2026-05-13T10:31:02+00:00

i wish to have a simple Action in my controller that accepts a few

  • 0

i wish to have a simple Action in my controller that accepts a few optional values and some integer values.

this is my route i wish to have:

HTTP.POST
/review/create

and this is the Action method i would like…

[AcceptVerbs(HttpVerbs.Post)]
public JsonResult Create(int userId,
                         int addressId,
                         byte baseScore,
                         byte reviewType,
                         string subject,
                         string description)
{ ... }

I’m under the uneducated impression that all of those arguments above will be populated by the forms collection values … but it’s not happening. Also, I have no idea how I would write a route, to handle those … because those values are form post data….

here’s my global.asax….

routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

    // Api - Search methods.
    routes.MapRoute(
        "Search Methods",
        "{controller}/{action}"
    );

In fact, the action method is never called because it doesn’t seem to find it 🙁

But, if create and action without any of those arguments, then it finds it ?????????

How would you write a route and action method to accept some require and some optional arguments, for the route /review/create ?

  • 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-13T10:31:03+00:00Added an answer on May 13, 2026 at 10:31 am

    As far as i can see you may rewrite your controller action like this:

    public ActionResult Create(int foo, int bar, byte blah, string name, int? xxx) {
        // code here
    }
    

    The ModelBinder will then ensure that foo,bar and blah are set. Name and xxx may be null. I can’t test it a the moment, but i think return type of the action should be ActionResult.

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

Sidebar

Related Questions

I have a very simple admin controller in my Rails 2 app that displays
I have have a simple script that I do not wish to close (exit)
I have a simple contact from that i wish to POST via a function
I have a simple array that looks like this: array (size=6) 0 => array
I have a seemingly simple problem whereby I wish to reconcile two lists so
I wish to have a page that has a fixed height (without scroll bars).
I wish to have a slider similar to they use. http://www.koovs.com/apple-ipod Can anyone suggest
I am trying to provide a very simple Do you wish to save this
I have a simple method that just does two lines and tries to return
We have a drupal site and we wish to export data from this site

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.