Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesDNN 8 - MVC: RedirectToAction not working.DNN 8 - MVC: RedirectToAction not working.
Previous
 
Next
New Post
3/11/2016 8:53 AM
 

This question is about the latest DNN platform release: DNN 8.0.1. I am trying to redirect to an action in my controller-classes, but I am not able to do it.

For example the following check:

// Check if user is voting on his own item if (item.CreatedByUserId == User.UserID) return RedirectToAction("Index");

This is the error I receive when the controller tries to return an action.DotNetNuke.Services.Exceptions.ModuleLoadException: No route in the route table matches the supplied values. ---> System.InvalidOperationException: No route in the route table matches the supplied values.

I don't know how routing is working in DNN (MVC) and I couldn't find anything helpful about is.

Thank you!

 
New Post
3/11/2016 10:18 AM
 
current release of DNN Platform is Version 8.0.0 (http://dotnetnuke.codeplex.com/)
are you using source or nightly build?

Cheers from Germany,
Sebastian Leupold (Microsoft MVP)

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
3/11/2016 1:10 PM
 

Thank you for your comment. Excuse me for the indistinctness. I am using DNN 8.0.0.

I am not able to route to actions (RouteToAction("actionName", "controllerName") in my controller. It is not included in the DnnController.
The error I receive reports that the specific action doen't exist in the route table (error above). I have no idea how to register them properly in the table.
Or, how I have at least, the possibility to route to an action in my controller.

 
New Post
4/7/2017 7:46 AM
 
You can RedirectToAction in this way:

var routeVals = TypeHelper.ObjectToDictionary(RouteData.Values);
routeVals["controller"] = "YouControllerName";
routeVals["action"] = "YouaActionName";
return Redirect(ModuleRoutingProvider.Instance().GenerateUrl(routeVals, ModuleContext));
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesDNN 8 - MVC: RedirectToAction not working.DNN 8 - MVC: RedirectToAction not working.


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.

Content Layout

Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out