I have an extremely simple control i'm trying to render which looks like this:
using System;
using System.Web;
using System.Web.UI;
namespace CORE.BusinessObjects.Web.Controls
{
public class TestControl : Control
{
protected override void Render(HtmlTextWriter writer)
{
writer.Write("Hello from TestControl!");
}
}
}
I'm calling the control in the following manner:
<%@ Register TagPrefix="Custom"
Namespace="CORE.BusinessObjects.Web.Controls" %>
<Custom:TestControl ID="testControl" runat="server" Visible="true">
</Custom:TestControl>
Am i doing something wrong? I have also failed to run ANY control samples i found online. Nothing executes. I can only execute the constructor of the control. Every other method i tried to override like Render()
or CreateChildControls()
doesn't get executed.
Thanks.
EDIT: I forgot to mention that the control is included on a page with a Master page. The control actually runs fine in the Master page, but not outside of it.