Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I want to redirect to another view throuh its associated controller, how can I do that? what kind of controller should I use? I tried with a SurfaceController and a return view() but it redirects wrong.
Hi Jose,
Try to use RenderControler - https://our.umbraco.org/documentation/reference/routing/custom-controllers
What method did you use for redirect?
Thanks,
Alex
Hi Alex,
I'm using surfacecontrollers, for some reason the Rendermvccontrollers are not working for me.
~Jose
Jose, can you show code what trying to make redirect for you?
Do you want to redirect to another view ? So render another view on this page is your goal?
Or redirect to another URL?
This my controller class (it only works when inherits from surfacecontroller)
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Umbraco.Web.Mvc;
namespace UmbracoTry3.Controllers { public class ReportSurfaceController : RenderMvcController { public ActionResult Index() { return View("View1"); } } }
I tried to call the controller from the view with this line but it didnĀ“t work, redirects to http://localhost:57544/umbraco/Surface/ReportSurface and finds nothing.
So I did this and it worked (for SurfaceController not for RenderMvcController)
<script type="text/javascript"> $(function(){ $("#btnBuscar").click(function () { window.location.replace("http://localhost:57544/Umbraco/Surface/ReportSurface/Index"); }); }); </script>
Thanks
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Redirect through controller
I want to redirect to another view throuh its associated controller, how can I do that? what kind of controller should I use? I tried with a SurfaceController and a return view() but it redirects wrong.
Hi Jose,
Try to use RenderControler - https://our.umbraco.org/documentation/reference/routing/custom-controllers
What method did you use for redirect?
Thanks,
Alex
Hi Alex,
I'm using surfacecontrollers, for some reason the Rendermvccontrollers are not working for me.
Thanks,
~Jose
Jose, can you show code what trying to make redirect for you?
Do you want to redirect to another view ? So render another view on this page is your goal?
Or redirect to another URL?
Thanks,
Alex
Hi Alex,
This my controller class (it only works when inherits from surfacecontroller)
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Umbraco.Web.Mvc;
namespace UmbracoTry3.Controllers { public class ReportSurfaceController : RenderMvcController { public ActionResult Index() { return View("View1"); } } }
I tried to call the controller from the view with this line but it didnĀ“t work, redirects to http://localhost:57544/umbraco/Surface/ReportSurface and finds nothing.
So I did this and it worked (for SurfaceController not for RenderMvcController)
Thanks
is working on a reply...