DNNCommunity / DNNDocs

The documentation site for the open source Content Management System DNN (formerly DotNetNuke).
https://docs.dnncommunity.org
23 stars 50 forks source link

Two MVC modules on one page and POST action conflict #693

Closed pzejer closed 1 year ago

pzejer commented 1 year ago

I put MVC module on the same page. Views of those modules include submit button and set of input/select controls. I crated POST Index action to take a parameters value. In my controller I have two actions Index() and [POST] Index(with_parameters) When I click button in the view of one module:

  1. It's call Index(with parameters) in second module
  2. Action Index(with parameters) is called in module one
  3. And just afer action Index(with parameters) the Index() action in the same controller is called. I have no idea whats going on. In the action with parametrs I make some logic and I want to redirect user to the certan page with additional parameters - but return Redirect(new-url-with-parameters) doesn't work and as I wrote just afer redirect the Inde() action is called again with return View(model) and user just stay on the same page without redirection.

MVC module one in the controller have: public ActionResult Index() { var model = .... return View(model); } and [HttpPost] Index(with-parameters) { var url = some logic to create url return Redirect(url); }

MVC module two is almost the same.

valadas commented 1 year ago

I don't know just enough MVC to be dangerous. But was this meant for a docs update or reporting an issue with the MVC pipeline ?

pzejer commented 1 year ago

I don't know just enough MVC to be dangerous. But was this meant for a docs update or reporting an issue with the MVC pipeline ?

In my opinion - reporting issue with MVC which, when will be confirmed I think that is meaningful for docs

valadas commented 1 year ago

You will probably get more help if you create an issue at https://github.com/dnnsoftware/Dnn.Platform/issues if it boils down that it is expected behaviour and needs to be somehow documented better, we can bring back a documentation issues here after that.