Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
XML
<ItemGroup>
  <Content Include="Reports\WebForm1.aspx" />
  <!-- I want to work with WebForm2.aspx in separate project -->
  <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>
<!-- file created in the project folder and added into project-->
<ItemGroup>
  <Compile Include="Reports\WebForm2.aspx.designer.cs">
    <DependentUpon>WebForm2.aspx</DependentUpon>
  </Compile>
</ItemGroup>



part of small project with linked pages :
XML
<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>
  <!-- file copied into local folder and added into project -->
  <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?
Posted
Updated 7-Oct-15 0:04am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900