How to get code extension for files in vb.net web application?

I am a C # guy, but I need to work with the vb.net application.

In a C # web application, you can expand the codebehind and designer files by clicking on the small arrow to the left of the .aspx file name.

However, I do not see this in the vb.net project. Instead, I have to open aspx and then press F7 to go to the code.

How can I tell the studios to show me the code files in the project explorer? .. besides selecting Show All Files, which also lists things that are not part of my project?

+4
source share
4 answers

There seems to be no way to do this for vb.net projects other than installing a solution explorer to display all files.

I filed a change request in Microsoft Connect at https://connect.microsoft.com/VisualStudio/feedback/details/590046/show-related-code-behind-files-for-vb-net-web-applications-in-solution -explorer


Interesting answer:

This is the standard behavior for all VB projects, and corresponds to the general philosophy of the VB team that their users are not complex enough to understand advanced concepts, for example, related to them, in a nested hierarchy .

(highlighted by me). Further comments after this are probably not needed.

+8
source

I know this is a little old question, but this is one of the best results on Google, and I found an alternative solution.

Open the .vbproj file for the project in a text editor and search for the name of your code. You will find that it looks something like this:

<Compile Include="dashboard\index.aspx.vb"> <DependentUpon>index.aspx</DependentUpon> <SubType>ASPXCodebehind</SubType> </Compile> 

If you simply remove the DependentUpon tag, everything will work fine, but both files will be displayed in Visual Studio as desired. So my final version will look like this:

 <Compile Include="dashboard\index.aspx.vb"> <SubType>ASPXCodeBehind</SubType> </Compile> 

It takes a bit of manual editing, but this works for me. Alternatively, if you manually rename / edit your files in page / codebehind format after creating regular class files, they will appear as buried in the project without resorting to "Show all files".

+2
source

What happens if you click on a file and press F7 (View Code)?

0
source

Based on Microsoft's answer shown above, why does Visual Web Developer 2010 show code by file in the project explorer for VB.net projects?

Is the implication that those who use the β€œabridged” version of Visual Studio to create VB.net projects are more difficult to understand such advanced concepts?

0
source

All Articles