为什么我找不到带.Aspx的.Aspx.Cs文件

问题描述:

朋友我正在使用visual studio开发Web应用程序,当我将我的html网站导入我的asp.net visual studio解决方案并将扩展名从.html转换为.aspx时,现在没有文件(default.aspx.cs)使用default.aspx我需要(defaul.aspx.cs)文件来编写数据库等代码

请提前帮助我!

friends i am using visual studio to develop web applications when i import my html website into my asp.net visual studio solution and convert the extension from .html to .aspx now there is no file of (default.aspx.cs) with default.aspx i need for (defaul.aspx.cs) file to write code for database etc
please help me thanks in advance !

只需将代码文件添加到项目中即可。如果您希望它正确地嵌套在解决方案资源管理器中,请编辑.csproj文件,如:



Just add a code code file to your project. If you want it to appear nested in Solution Explorer correctly, edit the .csproj file like:

<Compile Include="Global.asax.cs">
  <DependentUpon>Global.asax</DependentUpon>
</Compile>


参考: HTTP:// stackoverf low.com/questions/9770482/create-code-behind-file-after-aspx-has-been-created [ ^ ]