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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:15:47+00:00 2026-05-16T01:15:47+00:00

As I review more code and blog posts from lots of MVC sources, I

  • 0

As I review more code and blog posts from lots of MVC sources, I still haven’t wrapped my mind around what is “posted” when a request is made. I realize MVC doesn’t support post, but I’m having trouble finding resources that can explain it well enough to understand.

Inside the controller’s public ActionResult nameOfAction(what the heck goes here?) { ... } what are my parameters?

Sometimes it looks like Visual Studio scaffolds (int id, MyObject myobject) for an Edit-style action–it includes something from my model, but not always.

Sometimes, it’s (int id, FormCollection collection) for a delete-style action. Why not use the modeled object here? Is a FormCollection object always “posted”?

Sometimes, I see (RouteInfo routeInfo) which isn’t recognized in my MVC2 Intellisense (is this MVC1 only or something?)

How can/do/should I establish these parameters? I think this will help me a lot at design time.

  • 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-16T01:15:48+00:00Added an answer on May 16, 2026 at 1:15 am

    What gets post back from a form in MVC is the form data which includes each form element in a keyvalue pair.

    If you only need this information then you would use:

    public ActionResult nameOfAction(string name, string lastName, string etc)
    

    MVC has some smart data model binding which takes the form data and automatically creates an object which is part of you domain model. For instance it could automatically create a Person object with the provided form data.

    I believe there is a security concern with this as a user of your site may post data which is not part of your form and guess what your models are to inject their own data.
    I dont think this is a massive issue though and this is the way I would go.

    I think you can use the anti-forgery helper to prevent users from posting back data which is not allowed in a form. anti-forgery

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

Sidebar

Related Questions

This is a code review question more then anything. I have the following problem:
For various reasons (code review mostly) I need to switch from current development branch
After some code review I removed unnecessary properties which resulted in empty rules. So
For our code review process we open the details of a shelveset to see
I'm doing code review and came across a class that uses all static methods.
I got the code for showing activity indicator in a webview. I checked more
ISQL-SE 4.10.DD6 (DOS 6.22): My app has the following SQL script (CODE REVIEW) which
I have handling the exception in my code as below, but still get error
During a code review I was told to make sure that I do the
We recently had a code review . One of my classes was used so

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.