1

In WinForm and WebForm Application, Visual studio groups the 'View' File and 'Contorller' File, together. I found very easy to manage file in that way.

Now in ASP.Net Mvc , i'm finding difficult to manage views, separately in completely different folder.

Is there any way to group View and Controller files in VS Solution Explorer, like we used to do in WinForm and WebForm Application ?

alt text

2 Answers 2

3

I think they did that on purpose - views should be independent from controllers. Think of it like this: you should be able to put controllers into a totally different assembly and still have your application work. Your controllers should also be able to work with totally different set of views.

The framework is also setup to go to the views folder to fetch appropriate files. You would have to change that behavior yourself if you decide to move the views. Might not be worth the hassle.

And finally, if you really want to do it, you should probably look at your project file. There is a DependsUpon element that you can use to make a file go underneath another:

<Compile Include="Form1.Designer.cs">
  <DependentUpon>Form1.cs</DependentUpon>
</Compile>
Sign up to request clarification or add additional context in comments.

Comments

1

you can use VSCommands to group/ungroup files directly from Visual Studio

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.