2012-10-09 32 views

回答

1

我想這加載/編程添加控件,e.g時可能:

this.Controls.Add(LoadControl("~/mycontrol.ascx")); 

但是,如果你這樣做無條件的,那麼你會得到一個無限循環。

0

您不能:Circular file references are not allowed.

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs" Inherits="WebApplication1.WebUserControl1" %> 
<%@ Register TagPrefix="test" TagName="test" Src="~/WebUserControl1.ascx"%> 

這個代碼是不可能的

相關問題