Hello All,
I have a relatively big web-site and willing to have a small project to debug one or two pages.
Requirements for small project are:
- project location are different from web-site
- do NOT copy existing code into project folder
- allow using a form designer and other toolsets as usual
Problem :
- Web-site contain only *.aspx & *.aspx.cs (*.aspx.vb) files.
- *.design.cs (*.design.vb) didn’t exist on web-site.
- Without *.design file Studio (2010 & 2015) didn’t allow to use Form Designer in small project.
Question:
- How do I Link an existing *.aspx & *.aspx.cs into the small project, Edit and Save them.
Partial solution was created as following:
- *.aspx & *.aspx.cs added into small project as a Link’s.
- *.aspx & *.aspx.cs bounded using DependUpon
- *.design.cs creted and added to both Big and small projects
This allows completing Link, Edition and Save, but require two files in different places.
part of original (big) project:
<ItemGroup>
<Content Include="Reports\WebForm1.aspx" />
<Content Include="Reports\WebForm2.aspx" />
<Content Include="Reports\WebForm3.aspx" />
</ItemGroup>
<ItemGroup>
<Compile Include="Reports\WebForm1.aspx.cs">
<DependentUpon>WebForm1.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Reports\WebForm2.aspx.cs">
<DependentUpon>WebForm2.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Reports\WebForm3.aspx.cs">
<DependentUpon>WebForm3.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Reports\WebForm2.aspx.designer.cs">
<DependentUpon>WebForm2.aspx</DependentUpon>
</Compile>
</ItemGroup>
part of small project with linked pages :
<ItemGroup>
<Content Include="..\BigSite\Reports\WebForm2.aspx">
<Link>Reports\WebForm2.aspx</Link>
</Content>
</ItemGroup>
<ItemGroup>
<Compile Include="..\BigSite\Reports\WebForm2.aspx.cs">
<Link>Reports\WebForm2.aspx.cs</Link>
<DependentUpon>WebForm2.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Reports\WebForm2.aspx.designer.cs">
<DependentUpon>WebForm2.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
</ItemGroup>
Is there an option to avoid adding a *.design.cs file? Something what Studio used when edit pages without *.design.cs on existing web-site?