SF 8.2 - MVC Widget ActionLink results in "The method or operation is not implemented." error
I have an MVC widget that I'm trying to put an ActionLink on to go to another action in the same controller:
@model Company.Namespace.UserModel
<
hr
/>
<
div
>
<
ul
>
<
li
>User: @Model.Message</
li
>
<
li
>Customer: @Model.Customer</
li
>
<
li
>Clinic: @Model.CompanyName</
li
>
<
li
>@Html.ActionLink("View Orders", "ListOrders", "LoggedInUserInformationController")</
li
>
</
ul
>
</
div
>
<
hr
/>
When the page tries to render I get the following Yellow Screen and erorr
Server Error in '/' Application.
The method or operation is not implemented.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NotImplementedException: The method or operation is not implemented.
Source Error:
Line 7: <
li
>Customer: @Model.Customer</
li
>
Line 8: <
li
>Clinic: @Model.CompanyName</
li
>
Line 9: <
li>@Html.ActionLink("View Orders", "ListOrders", "LoggedInUserInformationController")</
li>
Line 10: <
li
>Route</
li
>
Line 11: @foreach (var r in Model.RoutePieces)
Source File: c:\Company\WebSite\Mvc\Views\LoggedInUserInformation\Index.cshtml Line: 9
Stack Trace:
[NotImplementedException: The method or operation is not implemented.]
Telerik.Sitefinity.Web.SitefinityRoute.GetVirtualPath(RequestContext requestContext, RouteValueDictionary values) +44
System.Web.Routing.RouteCollection.GetVirtualPath(RequestContext requestContext, RouteValueDictionary values) +98
System.Web.Mvc.RouteCollectionExtensions.GetVirtualPathForArea(RouteCollection routes, RequestContext requestContext, String name, RouteValueDictionary values, Boolean& usingAreas) +247
System.Web.Mvc.RouteCollectionExtensions.GetVirtualPathForArea(RouteCollection routes, RequestContext requestContext, String name, RouteValueDictionary values) +39
System.Web.Mvc.UrlHelper.GenerateUrl(String routeName, String actionName, String controllerName, RouteValueDictionary routeValues, RouteCollection routeCollection, RequestContext requestContext, Boolean includeImplicitMvcValues) +95
System.Web.Mvc.UrlHelper.GenerateUrl(String routeName, String actionName, String controllerName, String protocol, String hostName, String fragment, RouteValueDictionary routeValues, RouteCollection routeCollection, RequestContext requestContext, Boolean includeImplicitMvcValues) +50
System.Web.Mvc.HtmlHelper.GenerateLinkInternal(RequestContext requestContext, RouteCollection routeCollection, String linkText, String routeName, String actionName, String controllerName, String protocol, String hostName, String fragment, RouteValueDictionary routeValues, IDictionary`2 htmlAttributes, Boolean includeImplicitMvcValues) +60
System.Web.Mvc.HtmlHelper.GenerateLink(RequestContext requestContext, RouteCollection routeCollection, String linkText, String routeName, String actionName, String controllerName, String protocol, String hostName, String fragment, RouteValueDictionary routeValues, IDictionary`2 htmlAttributes) +50
System.Web.Mvc.HtmlHelper.GenerateLink(RequestContext requestContext, RouteCollection routeCollection, String linkText, String routeName, String actionName, String controllerName, RouteValueDictionary routeValues, IDictionary`2 htmlAttributes) +45
System.Web.Mvc.Html.LinkExtensions.ActionLink(HtmlHelper htmlHelper, String linkText, String actionName, String controllerName, RouteValueDictionary routeValues, IDictionary`2 htmlAttributes) +82
System.Web.Mvc.Html.LinkExtensions.ActionLink(HtmlHelper htmlHelper, String linkText, String actionName, String controllerName) +77
ASP._Page_MVC_Views_LoggedInUserInformation_Index_cshtml.Execute() in c:\Company\WebSite\Mvc\Views\LoggedInUserInformation\Index.cshtml:9
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +177
System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +80
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +113
System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +312
System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +115
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +248
System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +27
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +58
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +349
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +349
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +349
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +349
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +69
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +581
Telerik.Sitefinity.Mvc.ControllerWrapper.Execute() +160
Telerik.Sitefinity.Mvc.ControllerActionInvoker.ExecuteController(MvcProxyBase proxyControl) +123
Telerik.Sitefinity.Mvc.ControllerActionInvoker.TryInvokeAction(MvcProxyBase proxyControl, String& output) +170
Telerik.Sitefinity.Mvc.Proxy.MvcControllerProxy.ExecuteController() +64
Telerik.Sitefinity.Mvc.Proxy.MvcControllerProxy.OnPreRender(EventArgs e) +32
System.Web.UI.Control.PreRenderRecursiveInternal() +88
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +883
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1055.0
Any help would be appreciated. Thanks,
Hi Dave,
Can you please try to use the below markup for the ActionLink by specifying only the text for the link and the name of the action in the controller to be executed:
@Html.ActionLink("Link text", "YourActionName")
@Html.ActionLink("View Orders", "ListOrders")
Do you have any updates on this?
We are using sitefinity version 9.1.6111.0; and we are having the same problem, and by going to the JustDecompile, we have the following:
namespace Telerik.Sitefinity.Web
public class SitefinityRoute : RouteBase
public override VirtualPathData GetVirtualPath(RequestContext requestContext, RouteValueDictionary values)
throw new NotImplementedException();
Is there any configuration missing here? Why isn't it goes to the SitefinityMvcRoute?
I have been getting the same error. It was caused by a custom route handler that I added to the handlers collection in Application_Start.
My custom handler overrode SitefinityRoute, and did not override the method GetVirtualPath. As you noted, the method is not implemented in SitefinityRoute.
I decompiled Sitefinity code and investigated many of their own Route handlers. Turns out most of those handlers override the GetVirtualPath method and just return null.
I did the same and the problem was resolved:
public
override
VirtualPathData GetVirtualPath(RequestContext requestContext, RouteValueDictionary values)
return
null
;