Mar 16, 2016, 3:17 PM
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.
I have this organization for the areas and folders, for example:
I try with value for viewName variable:
And always get a "System.Exception: View with name '../Administration/LoadTab/... is not found"
Any idea to refer to the View LoadTabView?
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 TabPanelpublic 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