我有一个看起来像这样一个非常简单的用户控件:如何在特定位置呈现用户控件的孩子?
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="wfWindow.ascx.cs" Inherits="webfanatix.co.za.wfWindow" %>
<div>Just a test...[x]</div>
与此代码背后:
[ParseChildren(false)]
[PersistChildren(true)]
public partial class wfWindow : System.Web.UI.UserControl
{
protected override void Render(HtmlTextWriter writer)
{
RenderChildren(writer);
}
}
及其用法如下:
<wf:wfWindow runat="server">This content should go where [x] is.</wf:wfWindow>
我m没有ASP.NET Pro,那么我如何才能让内容准确呈现[x]出现在用户控件中的位置?
RenderChildren渲染我的内容,但它只附加到UserControl输出的末尾。我需要它去坐在正确的位置[x]。
在此先感谢!
用PHP来实现这种行为非常简单。 –