Problem opening a PartialViewResult with distinct Area View

  1. #1

    Problem opening a PartialViewResult with distinct Area View

    Hi again.

    I am trying to open a view in a new tab. But the view is placed in a Mvc folder Area.

    I have a View with a TabPanel and a button.

    X.TabPanel()
        .ID("TabPanel1")
        .Region(Region.Center)
        .Padding(1)
        .Plugins(X.TabScrollerMenu().PageSize(100))
    ,
    X.Button()
    .Text("Update tabs")
    .DirectEvents(de =>
    {
         de.Click.Action = "onClick";
    }
    The controller code create a new PartialViewResult and add it to the TabPanel

    public ActionResult onClick()
    {
       string viewName="standarView";
       Ext.Net.MVC.PartialViewResult newTab= new Ext.Net.MVC.PartialViewResult("TabPanel1");
       newTab.ViewName = viewName;
       newTab.RenderMode = RenderMode.AddTo;
    
       this.GetCmp<TabPanel>("TabPanel1").SetLastTabAsActive();
       return newTab;
    }
    But i can't open a View who is in the Area.

    I have this organization for the areas and folders, for example:
    Folder Controllers
          ExtNetController.cs (where id have the previous code)
    Folder Views
          Folder ExtNet
               TabPanelView.cshtml (Where i have the tab panel and the previous code)
               standarView.cshtml
    Folder Areas
         Folder Administration
              Folder Controllers
                   LoadTabController.cs
              Folder View
                   Folder LoadTab
                        LoadTabView.cshtml
    LoadTabView and standarView have the same code, but i can open only standarView.
    I try with value for viewName variable:
    • "../Administration/LoadTab/LoadTabView"
    • Renaming LoadTabView as index.cshtml and with "../Administration/LoadTab/"
    • .....

    And always get a "System.Exception: View with name '../Administration/LoadTab/... is not found"

    Any idea to refer to the View LoadTabView?
    Last edited by sishco; Mar 16, 2016 at 3:30 PM. Reason: code error
  2. #2
    Solution:

    Use the real path:

    nombreVista = "~/Areas/Administration/Views/MeasurementUnit/MeasurementUnitView.cshtml";

Similar Threads

  1. [CLOSED] Problem opening a popoup window
    By sisa in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Dec 15, 2011, 12:31 PM
  2. [CLOSED] Problem opening a Window that contains UserControl
    By nhg_itd in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 26, 2011, 3:42 AM
  3. [CLOSED] Universal PartialViewResult Problem
    By tiramisu in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Dec 28, 2010, 1:27 PM
  4. Problem with GMapPanel in MVC2 using PartialViewResult
    By tiramisu in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Nov 23, 2010, 7:56 AM
  5. [CLOSED] PartialViewResult Problem
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Jan 27, 2010, 11:15 AM

Posting Permissions