+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Url.Action or filterContext.Result = new RedirectToRouteResult(new RouteValueDictionary { { "controller", ControllerString }, { "action", ActionString } }); does not work

Url.Action or filterContext.Result = new RedirectToRouteResult(new RouteValueDictionary { { "controller", ControllerString }, { "action", ActionString } }); does not work

2 posts, 0 answered
  1. Andrew
    Andrew avatar
    8 posts
    Registered:
    25 May 2012
    31 May 2013
    Link to this post
    Hi. When I use Url.Action or filterContext.Result to return the relative path Sitefinity returns/rewrite the defualt to Sitefinity/Themes?controller=controllername&action=actionname. Any ideas of to what is causing this? Is there a simple way to have a URL with the following format: /controllername/actionname everytime I use Url.Action in the controller of filterContext.Result.
    Thanks.
  2. Ivan Eftimov
    Ivan Eftimov avatar
    23 posts
    Registered:
    20 Jul 2016
    03 Jun 2013
    Link to this post
    Hello Andrew,

    Thank you for contacting Sitefinity support.

     Url.Action or filterContexts.Result with the route you create with

    new RouteValueDictionary { { "controller", ControllerString }, { "action", ActionString } }

    will give you the /pageurl/actioname route because that is how Sitefinity MVC widgets work - the controller name is replaced by the page name. 
    Still, I cannot reproduce the result which you reported, so I would like to ask you for more details like description of the widget setup, the code of the widget so i would be able to set it up here and explore it in details, and everything else which you think might be useful.
    We are waiting for your input so we would be able to give you some more details as soon as possible.


    Regards,
    Ivan
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered