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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:11:25+00:00 2026-05-19T03:11:25+00:00

I am absolute beginner in C#, ASP.NET and MVC2 and this means that I

  • 0

I am absolute beginner in C#, ASP.NET and MVC2 and this means that I just might be missing something exceptionally basic. I tried to search for it, but here again, I failed to come up with the proper incantations for neither Google not StackOverflow, so here comes the question:

I am trying to create a basic controller with two actions:

[HttpPost]
public ViewResult Create(CustomerCreateData data)
{
    CustomerRecord cr = //create customer record from input data...

    return RedirectToAction("Details");
}

public ViewResult Details(int id)
{
    CustomerRecord cr = // load customer record with specified id...
    return View(cr);
}

My idea is thet after successful POST /Customer/Create the user would be redirected to GET /Customer/Details/42 where 42 is id of the newly created customer record.

What is the proper incantation for this in ASP.NET MVC2

PS – I’ve seen countless examples of redirecting to "Index" action, but that is not quite enough.

  • 1 1 Answer
  • 4 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-19T03:11:26+00:00Added an answer on May 19, 2026 at 3:11 am

    You can pass data to the RedirectToAction method:

    return RedirectToAction("Details", new { id = cr.Id });
    

    This is assuming you either have a defined route, e.g. Customer/Details/{id} or that you still have the default route {controller}/{action}/{id}.

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

Sidebar

Related Questions

I'm an absolute beginner with ASP.NET[MVC] so this is probably a dumb question. I
I'm just playing with some linq and asp.net - absolute beginner so I'm not
Absolute beginner question: I have a template file index.html that looks like this: ...
I am an absolute beginner at ASP.NET. How can I learn it better? Currently
I'm an absolute beginner at grails and I'm stumbling on something that should be
This is an absolute beginner's question, but per the latest podcast, I understand that
I'm an absolute beginner with ASP.NET MVC and I'm trying to build a pretty
[First, I'm an absolute beginner. I tried to express myself as good as I
This is an absolute beginner question in TFS SDK: I am trying to connect
I am a absolute beginner in Windows Phone Development with a basic idea in

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.