how to get current page and its parent page name in view?

Muhammad Kaleem asked on June 6, 2019 22:25

how can i get current page name and its parent page name in the view (index.cshtml) file directly?

please suggest

thanks

Recent Answers


Zach Perry answered on June 6, 2019 22:58

Are you using page builder? If so I believe the only way would be to pass the page you get in the controller to view.

Otherwise a view doesn't necessarily line up with a page.

0 votesVote for this answer Mark as a Correct answer

Muhammad Kaleem answered on June 6, 2019 23:09

thanks zach, i'm not using page builder but i'm returning my view from controller, please suggest

0 votesVote for this answer Mark as a Correct answer

Zach Perry answered on June 6, 2019 23:11

you have to get the page in the controller and pass it to the view then.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.