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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:15:58+00:00 2026-05-27T11:15:58+00:00

Is it possible to pass an object to a Controller? For example, I have

  • 0

Is it possible to pass an object to a Controller? For example, I have ActionLink and I am pass the Model as Id.

@Ajax.ActionLink(
            "Next", 
            "Step",
            new { StepId = 2, id = Model }, 
            new AjaxOptions { UpdateTargetId = "stepContainer" }, 
            new { @class = "button" })

And the Controller has

public ActionResult Step(int StepId, object id)
{
}

How can I do this? Is this silly?

  • 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-27T11:15:59+00:00Added an answer on May 27, 2026 at 11:15 am

    No, you cannot pass objects like this. An ActionLink helper generates an anchor tag which when clicked sends a GET request to the server. In this GET request you will have to include everything that you want the server to receive as part of the query string.

    Another possibility is to only send the id of this model so that the controller action can fetch it back from the datastore from which it initially fetched it when rendering the page:

    @Ajax.ActionLink(
        "Next", 
        "Step",
        new { 
            StepId = 2,
            id = Model.Id
        }, 
        new AjaxOptions { UpdateTargetId = "stepContainer" }, 
        new { @class = "button" }
    )
    

    and in the controller action:

    public ActionResult Step(int StepId, int id)
    {
        var model = Repository.GetModel(id);
        ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In rails, is it possible to pass arguments in when making a new object,
Is it possible to pass a delegate to a WCF remote object from the
Is that possible to make a UIToolbarButton pass an object to its target by
Is it possible for a client to pass an RMI object as an argument
I have a servlet (front-controller), which analyse the request, prepare some necessary data (model)
Is it possible to pass an anonymous function as an argument, and have it
It's simple enough to pass a string to a controller action via jQuery ajax,
Is it possible to pass an ArrayCollection object from flex ExternalInterface.call() as a parameter
I have an object that has a to_csv method and I want to pass
I'm new to MVC2 and was wondering if it was possible to pass an

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.