skyler.severns wrote:Note that the plugin is attached to Widget to display the PublicInfo.cshtml on the user view. However, I like to have a full Configuration page within the Admin view (not use ChildActionOnly).
Let me know if this is possible. Thanks guy
In the child action view you could add a html link to the new full page view you want (or use javascript to automatically redirect). In a new full page view you would use the following code at the top of the view to get the same theme as the administration console.
@{
Layout = "~/Administration/Views/Shared/_AdminLayout.cshtml";
}
Thanks for your quick reply. This is the error I received
Server Error in '/' Application.
The partial view 'Menu' was not found or no view engine supports the searched locations. The following locations were searched:
~/Themes/DeepSkyBlue/Views/Banners/Menu.cshtml
~/Themes/DeepSkyBlue/Views/Banners/Menu.vbhtml
~/Themes/DeepSkyBlue/Views/Shared/Menu.cshtml
~/Themes/DeepSkyBlue/Views/Shared/Menu.vbhtml
~/Views/Banners/Menu.cshtml
~/Views/Banners/Menu.vbhtml
~/Views/Shared/Menu.cshtml
~/Views/Shared/Menu.vbhtml
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.InvalidOperationException: The partial view 'Menu' was not found or no view engine supports the searched locations. The following locations were searched:
~/Themes/DeepSkyBlue/Views/Banners/Menu.cshtml
~/Themes/DeepSkyBlue/Views/Banners/Menu.vbhtml
~/Themes/DeepSkyBlue/Views/Shared/Menu.cshtml
~/Themes/DeepSkyBlue/Views/Shared/Menu.vbhtml
~/Views/Banners/Menu.cshtml
~/Views/Banners/Menu.vbhtml
~/Views/Shared/Menu.cshtml
~/Views/Shared/Menu.vbhtml
Source Error:
Line 77: {
Line 78: <div class="header-menu">
Line 79: @Html.Partial("Menu")
Line 80: </div>
Line 81: }
Source File: c:\Users\Tri\Documents\Koneka\Koneka\NopCommerce\Main\Presentation\Nop.Web\Administration\Views\Shared\_AdminLayout.cshtml Line: 79
Stack Trace:
[InvalidOperationException: The partial view 'Menu' was not found or no view engine supports the searched locations. The following locations were searched:
~/Themes/DeepSkyBlue/Views/Banners/Menu.cshtml
~/Themes/DeepSkyBlue/Views/Banners/Menu.vbhtml
~/Themes/DeepSkyBlue/Views/Shared/Menu.cshtml
~/Themes/DeepSkyBlue/Views/Shared/Menu.vbhtml
~/Views/Banners/Menu.cshtml
~/Views/Banners/Menu.vbhtml
~/Views/Shared/Menu.cshtml
~/Views/Shared/Menu.vbhtml]
System.Web.Mvc.HtmlHelper.FindPartialView(ViewContext viewContext, String partialViewName, ViewEngineCollection viewEngineCollection) +386082
System.Web.Mvc.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, TextWriter writer, ViewEngineCollection viewEngineCollection) +266
System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +113
System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName) +31
ASP._Page_Administration_Views_Shared__AdminLayout_cshtml.Execute() in c:\Users\Tri\Documents\Koneka\Koneka\NopCommerce\Main\Presentation\Nop.Web\Administration\Views\Shared\_AdminLayout.cshtml:79
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +207
System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +81
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +88
System.Web.WebPages.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer) +102
System.Web.WebPages.HelperResult.WriteTo(TextWriter writer) +12
System.Web.WebPages.WebPageBase.Write(HelperResult result) +67
System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +66
System.Web.WebPages.WebPageBase.PopContext() +262
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +95
System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +220
System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +115
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +303
System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +23
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +177
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343
System.Web.Mvc.Controller.ExecuteCore() +116
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8963149
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237
The URL that I'm accessing is /Plugins/Banners.
It seems not to be able to render other views properly. The View which it is accessing comes from the Controller of the plugin which is outside of the Admin project.
Am I doing it a right way?