Create code behind file after aspx has been created

前端 未结 5 514
有刺的猬
有刺的猬 2021-02-01 16:57

I just inherited a web site that was created by a designer. The site was originally created with all *.html files. The designer renamed all the *.html files to *.aspx files.

5条回答
  •  粉色の甜心
    2021-02-01 17:29

    After you add the new .cs file, you may want to see the file look like a codebehind file (indented, icon, etc). To do so:

    1. Unload the project
    2. Edit the project
    3. Find the new filename (file.aspx.cs) in the section with files.
    4. Add an xml node for DependentUpon.
    5. Save and Close the project
    6. Reload the project

    For a file Profile.aspx.cs, the xml should look something like this:

    
      Profile.aspx
      ASPXCodeBehind
    
    

提交回复
热议问题