Mike Roosa
Mike Roosa

Reputation: 4812

How do I apply conditional logic to determine which master page to display in asp.net?

I have 2 master pages and a single content page. How do I show employees one master page and customers a different one?

This is for an asp.net mvc app.

Upvotes: 0

Views: 591

Answers (1)

Tim Scott
Tim Scott

Reputation: 15205

You can specify the master in the View method in your action:

return View("MyPage", isCustomer ? "CustomerMasterPage" : "EmployeeMasterPage")

Upvotes: 2

Related Questions