Giter VIP home page Giter VIP logo

Comments (1)

jbogard avatar jbogard commented on September 4, 2024

What's it look like from the browser in terms of the request?

On Friday, July 22, 2016, Tim [email protected] wrote:

Hi Jimmy,

I have very straightforward create action in my controller. After creation
I want to redirect to the edit action so the user can continue to edit the
newly created item. However the RedirectToActionJson doesn't seem to work
properly even though stepping through the code the edit action is being
called but the redirection to the edit URL still indicates the create
action (/SomeAction/Create) when I would have expected
/SomeAction/Edit/[new id]

Could it be something to do with some StructureMap "magic" around ending
the request (StructureMapScopeModule) because I'm using Autofac?

[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Create(CreateEdit.Command command)
{
var id = _mediator.Send(command);
return this.RedirectToActionJson(c => c.Edit(new CreateEdit.Query { Id = id }));
}

public ActionResult Edit(CreateEdit.Query query)
{
var model = _mediator.Send(query);
return View("CreateEdit", model);
}


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#27, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AAGYMtYBuL-0wdr-dlxS9enVDm1eBNhTks5qYGy_gaJpZM4JSf3N
.

from contosouniversity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.