开发者

VIsual Studio : ASP.NET Extra Page Files

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

My goal is to be able to have this extra file created with every ASPX page, and then use a custom MS Build Task to analyze those files and do some stuff.

So for example, when I created "MyPage.aspx", I'd actually see these files on disk...

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

I want to be abl开发者_JAVA百科e to see the file when I expand a page and be able to edit the file.

Possible?


A way to group files by-hand:

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

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


I am just throwing some ideas about here but have you looked into t4 templates?

Also could you specify which version of Visual Studio you are looking to extend? I say this because if its VS2010 then there are a LOT of new extensibility points opened up within VS so you have a much better chance of this being possible.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜