代码之家  ›  专栏  ›  技术社区  ›  Gabe Sumner

什么程序集ASP.NET用户控件放入?

  •  0
  • Gabe Sumner  · 技术社区  · 16 年前

    我在中创建的类 ~/App\u代码 被放入 应用程序代码 装配。

    如果我创建以下ASP.NET用户控件:

    ~/用户控件/基本控制.ascx

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="BasicUserControl.ascx.cs" Inherits="UserControl_BasicUserControl" %>
    Hello world!
    

    ~/用户控件/基本控制.ascx.cs

    using System;
    
    public partial class UserControl_BasicUserControl : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
    
        }
    }
    

    这个动态的程序集是什么ASP.NET是否将用户控件添加到?

    2 回复  |  直到 16 年前
        1
  •  3
  •   Element    16 年前

    建立您的网站,然后签出ASP.UserControls基本用户控件命名空间/类

    每次您对.ascx进行更改时,您都必须构建项目以使更改显示在intellisense中

        2
  •  0
  •   azamsharp    16 年前

    如果打开新创建的UserControl程序集,您将意识到UserControl的命名空间是ASP。因此,这意味着当使用register指令在页面上注册usercontrol时,必须将命名空间提到ASP。在此之后,编译并重新构建您的应用程序,您将获得intellisense支持。

    我已经创建了一个关于这个场景的视频让我知道,我将发布一个链接。