VIsual Studio: Additional ASP.NET Page Pages

Is there a way to write a VS add-in or something else that would allow me to link files to an ASPX page in ASP.NET.

My goal is to have this extra file created on every ASPX page, and then use the custom MS build task to parse these files and perform some actions.

So, for example, when I created "MyPage.aspx", I would really see these files on disk ...

  • Mypage.aspx
  • MyPage.aspx.cs
  • MyPage.aspx.designer.cs
  • MyPage.aspx.MyExtension

I want to see the file when I expand the page and can edit the file.

Possible?

+4
source share
2 answers

File grouping method:

Edit the .proj file, find the line <Compile Include="MyPage.MyExtension.cs"> and add the subnode:

 <Compile Include="MyPage.MyExtension.cs"> <DependentUpon>MyPage.aspx</DependentUpon> </Compile> 
+1
source

I'm just voicing some ideas, but have you looked into t4 templates?

Also you can specify which version of Visual Studio you want to expand? I say this because if its VS2010, then there are many new extensibility points open in VS, so you have a lot more chance of it.

0
source

Source: https://habr.com/ru/post/1305043/


All Articles