In my C# ASP.NET Web Site using .NET Framework 4.0, I have a couple of pages where the related .cs file is not under its related aspx file. I recently moved the files to a subdirectory. I have 10 pages and for 8 of them the move worked just fine and the .cs file is under the aspx. However for two pages, the .cs file now no longer shows below the aspx file. How can I fix this so that the cs is shown correctly underneath the aspx file? When I compare the top of the markup pages, the two problem pages look just like the other 8 pages. I don't see any issues there.
First make sure they have the same name (except for the extension of course). If this does not help and it's a Web Application then try removing the 3 files (.aspx, .aspx.cs, aspx.designer.cs) from the project by right-click -> 'exclude from project'. Then add them again. The easiest way is to show all files (hint: screenshot), then right-click -> 'Include in project'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With