rich2020
  •  rich2020
  • 57.2% (Neutral)
  • YAF Camper Topic Starter
2014-06-26T21:08:16Z
Hi all,

I'm working with an MVC 4 application and have intergrated the membership and what-not, but am having trouble with the master page. In MVC Razor, the master page is called "_Layout.cshtml" and on that page, the navigation, the css, JS... etc are all kept as a "core" of the site. This really works the same way as the ASP.NET master page.

What I've done is I've created a controller "Forums" and when the user hits the "Index" action, they are taken to a view (webpage) with an iframe.

This iframe loads in the YAF forums and all is well... until I navigate to my profile or some other part of YAF.

The reason for this is that because entering the forums via the /controller/action and then have the iframe load the forums causes the forum to be rendered within an iframe and allows the view behave as a master page.

However, when I navigate to another part of the forum, the initial /controller/action is lost and the forum loads as if it was being accesed simply via a regular URL EG. http://mysite/forums.

Has anyone here managed to get the forums working with an MVC razor master page? Does anyone have any suggestions for me?

It seems that when visiting anything outside of the regular forum - eg: My profile, My Albums... the URL gets reset. EG: http://localhost:100/YAFForums/ - here the forums work fine with the master page included... but when I navigate to My Profile: http://localhost:100/YAF/Forums/default.aspx?g=cp_profile

http://localhost:100/YAF/Forums/ is the real location and http://localhost:100/YAFForums/ is being routed via the controller.


Many thanks!
Rich
Sponsor
silentcid
2014-07-01T03:25:31Z
I'm not quite sure if this will help you considering he's using MVC5; however, maybe some ideas on here will help you in figuring out a solution to your problem. The article author Dino Esposito talks about mixing webforms with MVC so it's worth a shot.

https://www.simple-talk....b-forms-and-asp.net-mvc/ 
deggen40
2014-07-07T15:33:54Z
I ended up modifying the master page of the forum so that it was just like the layout of the MVC portion of the site.

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved