asp.net - Do I need a shared view for navigation between controllers? -


I am very new to ASP.NET MVC and it is probably a clear fact ... In fact, I can not use the "Forum" view that I created in the "Home" folder (because I'm on my main homepage A link to the forum is required.) I was wondering if it's okay to just move forum views to a shared folder? Is this a bad practice? It seems that I now have a strong coupling, because on one side, the Forum view is called inside the Home Controller, and on the other hand it will always be used with the Forum Controller. So can it be unnecessary / wrong?

EDIT: If I do this, the URL changes in an odd way, so will the right solution be correct? First of all, when I click on the Forums link on the main page, I'm at / home / forum. I look at the forum, everything is fine. Now I click on "Post topic", and after roundtrip / forum / posttext The house is gone.

If you have forum controller it needs related ideas Located on ~ / views / forums . For example:

  Public category forum controller: controller {public performance index} {return view (); }}   

and after that you will see related views in ~ / views / forum / index.cshtml :

  @ { ViewBag.Title = "Forum"; } & Lt; H2 & gt; Forums & lt; / H2 & gt; & Lt; P & gt; Put Content Here & Lt; / P & gt;   

And finally you can generate a link like index to forum controller :

 < Code> @html.exeLink ("Go to Forum", "Index", "Forums")    

Comments