CodeFile vs CodeBehind(CodeFile 与 CodeBehind)
问题描述
CodeFile="file.ascx.cs"和CodeBehind="file.ascx.cs"在ASP.NET用户声明中有什么区别控制?
What is the difference between CodeFile="file.ascx.cs" and CodeBehind="file.ascx.cs" in the declaration of a ASP.NET user control?
是更新的还是推荐的?还是有特定的用途?
Is one newer or recommended? Or do they have specific usage?
推荐答案
CodeBehind:需要编译(ASP.NET 1.1 模型).编译后的二进制文件放在网站的 bin 文件夹中.在部署之前,您需要在 Visual Studio 中进行编译.当您不希望源代码以纯文本形式查看时,这是一个很好的模型.例如,在向您没有义务提供代码的客户交付时.
CodeBehind: Needs to be compiled (ASP.NET 1.1 model). The compiled binary is placed in the bin folder of the website. You need to do a compile in Visual Studio before you deploy. It's a good model when you don't want the source code to be viewable as plain text. For example when delivering to a customer to whom you don't have an obligation to provide code.
CodeFile:您为源文件提供部署解决方案.ASP.NET 2.0 运行时在需要时编译代码.编译后的文件位于 Microsoft.NET[.NET version]Temporary ASP.NET Files.
CodeFile: You provide the source file with the solution for deployment. ASP.NET 2.0 runtime compiles the code when needed. The compiled files are at Microsoft.NET[.NET version]Temporary ASP.NET Files.
这篇关于CodeFile 与 CodeBehind的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:CodeFile 与 CodeBehind
基础教程推荐
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
