首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在asp.net 4.0中查看自动生成的代码?

如何在asp.net 4.0中查看自动生成的代码?
EN

Stack Overflow用户
提问于 2013-09-10 04:04:06
回答 1查看 568关注 0票数 0

我无法在asp.net中看到自动生成的代码,因为我们可以在带有designer.cs文件的win表单中看到此代码。

代码语言:javascript
复制
partial class Form1
{
    /// <summary>
    /// Required designer variable.
    /// </summary>
    private System.ComponentModel.IContainer components = null;

    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    protected override void Dispose(bool disposing)
    {
        if (disposing && (components != null))
        {
            components.Dispose();
        }
        base.Dispose(disposing);
    }

    #region Windows Form Designer generated code

    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
        this.components = new System.ComponentModel.Container();
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.Text = "Form1";
    }

    #endregion
}
EN

回答 1

Stack Overflow用户

发布于 2013-09-10 04:08:05

如果您使用的是ASP.NET“网站”,那么就没有自动生成的代码。无需使用设计器文件即可分析和编译标记。

在"Web应用程序“中,您可以将自动生成的设计器文件与常规的代码隐藏文件一起使用。它位于一个分部类中,所以实际上每个页面有三个物理文件(.aspx、aspx.cs、.aspx.designer.cs)。

这两个概念彼此非常不同,所以如果你不清楚其中的区别,我建议你在asp.net website vs web application上搜索一下,看看其他一些更重要的区别。

尽管WebSite确实有优势,但大多数人倾向于发现Web Application是两者中的首选--它是一个更“真实”的.NET项目。此外,在WebForms之上继续发展的Web只在“ASP.NET应用程序”中可用,而不是"WebSite“。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18706107

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档