Dynamic nested master page in ASP.net MVC Razor - asp.net-mvc-3

I've got some views that share a master page and I want to programatically set the master page for the master page. Is it possible to do this? How do I get a reference to the master of a master?
Cheers, Ian.

Return layout page file as part of model. and specify the LayoutPage property from the model as follows:
#{
LayoutPage = ViewBag.LayoutPage;
}
Please refer following link for basic razor layout page concepts
Layout/Master pages using Razor

Related

Handling multiple views controllers in CodeIgniter 4

I am new to CodeIgniter 4.
I have one controller named Pages and helps to display website pages normally. Then I have another controller named Admin which is suppose to load the admin view with its own header and footer files.
While Pages controller works fine, the Admin controller keeps saying 404-file not found admin.
I think I have a problem with my current Route settings below. Please help.
$routes->setDefaultController('Pages');
$routes->setDefaultMethod('default');
// Route Definitions
$routes->get('/', 'Pages::index');
$routes->get('(:any)', 'Pages::default/$1');
try ajusting your code like this.
$routes->setDefaultController('Pages');
$routes->setDefaultMethod('default');
// Route Definitions
$routes->resource('pages');
$routes->get('/', 'Pages::index');
$routes->get('(:any)', 'Pages::default/$1');

Url.Action alternate in razor page view model class

What can be used to get the URL of the page which is in this path of the project <website>/Pages/Account/Logout.cshtml
This is using view model razor pages and not mvc controller/action
When I use Url.Action("/Account/Logout", new { logoutId = ogoutId }); it says cannot resolve action /Account/Logout
In Razor Pages, you could use #Url.Page.
Logout
Or use asp-page directly,see more usage here.
<a asp-page="/Account/Logout" asp-route-logoutId ="1">Logout</a>

AdxStudio: How display an entity form in Web template(Liquid Templates)

I am trying to display an entity form in a adxStudio web template, found one link Using Liquid to display EntityForm
<div class="container">{% entityform name:'My Entity Form' %}</div>
but this did't work for me.
Please help me to put an entity form on web template in adxstudio.
Thanks in advance......
Solved It!
Initially I am trying to display the web template with footer web template of home page, which did't work.
For displaying Entity form We need to:
Place the Entity Form in Web template like <div class="container">{% entityform name:'My Entity Form' %}</div>
Associate the Web template to a Page template
Page template needs to associate to a Web page
Browse the page, finally you will see/submit your form.
Thanks!

Oracle apex create page that does not use page 0 master template

I have a master template for my app , page 0 and every page that I create inherits this template. I however want to create a page that does not use this template within my application. How can I do this?
Create a new page template with whatever formatting you want for this page and assign it to the page instead of the default by selecting it from the drop-down list in Page Attributes.

How can I create a login partial view in MVC?

How can I create a login partial view in MVC 2.0?
I want to include this in several masterpages in my site since I can't use the login control in MVC.
What code do I put in the controller which will accept the username and password?
The default MVC project creates one for you. Just install MVC and create a MVC project. It will have a Master page, with a login partial view already created.

Resources