In Visual Studio (2008) is there a way to have a custom dependent file on another custom file?

前端 未结 6 856
我在风中等你
我在风中等你 2020-12-01 11:33

Instead of a *.cs code behind or beside I\'d like to have a *.js file. I\'m developing a MVC application an have no need for a code beside because I have controllers, but i

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-01 12:10

    If you need to add code-behind for some file there is a workaround. For instance you want to make Test.xaml.cs a child of Test.xaml. Complete the following steps:

    1. Exclude both Test.xaml and Test.xaml.cs from project, save project.

    2. Unload project.

    3. Reload project.

    4. Click "Show hidden files" in File Explorer pane.

    5. File Test.xaml.cs will be displayed as child of Test.xaml.

    6. Add files back to project, save project.

    That's it. Now Test.xaml.cs is dependent on Test.xaml.

提交回复
热议问题