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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:10:44+00:00 2026-05-15T21:10:44+00:00

I have an action Create() on my BooksController, where I create a new Book

  • 0

I have an action Create() on my BooksController, where I create a new Book class. Part of this create process is to add one or more Authors, where Author is a class.

Here’s the way I envision this working:

When user clicks “Create a new book” they are returned the Create view.

User can click “Add Author” button at any time. “Add Author” posts and saves all data in session, then RedirectToAction(“Search”, “Author”, new { returnController=”Books” returnAction=”AddAuthor” } (pseudo)

That will return an AuthorId to the AddAuthor Action, which gets the new Book class out of session, updates with author, and redirects back to Create()

My question – is this the best way to handle a ‘return to’ with MVC? What if I wanted to have the Author Search include an ‘add new author’ option? I’d want to return to one URL, that returned the ID to a second URL. seems really confusing, could use some help. thanks.

  • 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-15T21:10:45+00:00Added an answer on May 15, 2026 at 9:10 pm

    I suggest that u make your AddAuthor controller takes nullable id of the author.

    So when u have null id, you can redirect to an action to create an author, that will later return an id of the author that was created and then add it to the book.

    And when you do pass the id it will just add the author to the specified book.

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

Sidebar

Related Questions

I have controller with action new , and I want it to create ActiveRecord::Base
I have a button like that : <a href=@Url.Action(Create, City) class=save button><span class=icon-save></span>Save</a> Than
I have a create action in one of my controllers which responds to ajax
I currently have this action to create an object. def create @campaign = Campaign.create(params[:campaign])
in a controller I have a create action def create params[:note] @note = current_user.notes.new(params[:note])
I have an action which create QMessageBox. In that dialog I want to print
If i have a controller action Create that returns a view with the following
I have a create action for a form that potentially generates errors (i.e. first
I have a create action in the controller that I use for a form
I have an ASP.NET MVC 3 application which has a post action called Create

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.