在VS中建立.aspx,.cs,.designer.cs之间的级联关系

    <Compile Include="..AdminActions.aspx.cs">
      <DependentUpon>Actions.aspx</DependentUpon>
        <SubType>ASPXCodeBehind</SubType>
    </Compile>
    <Compile Include="..AdminActions.aspx.designer.cs">
      <DependentUpon>Actions.aspx</DependentUpon>
        <SubType>ASPXCodeBehind</SubType>
    </Compile>

csproj项目文件中,形成这样的代码,重要的是<DependentUpon>这一节,如果没有它,在VS中就不会形成级联关系,而是并列。

如果没有designer.cs文件,最直接的效果就是在cs中右键时没有“查看设计器”。

原文地址:https://www.cnblogs.com/Sabre/p/4289732.html