I was wondering if it is possible to do something like this:
<uc1:TestControl ID="TestControl1" runat="server">
<div>More random HTML, etc...</div>
</uc1:TestControl>
I got an error of "Type 'System.Web.UI.UserControl' does not have a public property named 'div'.". Doing a little research, I found I could add the following property to the server control:
[ParseChildren(false)]
public partial class TestControl : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
Is it possible to read the content from an ASP.NET control?
Edit: Changed wording to reflect that I am curious if you can do this with either a server or user control