我有数据列表项,我想从后面的代码中加载不同的用户控件。
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TextQuestion.ascx.cs" Inherits="QuestionnaireUI.TextQuestion" %>
<div>
Name: <asp:Label ID="CategoryNameLabel" runat="server"
Text='<%# Eval("Description") %>'>
</asp:Label>
<input type="text" />
</div>
应该将用户控件添加到交替模板的行
dlSubjects.AlternatingItemTemplate = Page.LoadTemplate("TextQuestion.ascx");
这个想法取自 msdn 库,但无论如何我在页面加载后都看不到页面中的用户控件,即使在页面源中也看不到。谢谢