KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a project and I am trying to register a custom server control (there is no .ascx file) on the page. I am currently using Class Declaration namespace MyApp.Controls{ public class CustomControl: WebControl{ public string Text { get { String s = (String)ViewState["Text"]; return ((s == null) ? String.Empty : s); } set { ViewState["Text"] = value; } } protected override void RenderContents(HtmlTextWriter output) { output.Write(Text); } } } On my page, <%@ Register TagPrefix="myControls" Namespace="MyApp.Controls" %> <myControls:CustomControl runat="server" Text="What up!" /> I receive a Parser Error, with the message "Unknown server tag 'myControls:CustomControl'." What am I doing wrong?
Tags (comma-separated)
Save Edits
Cancel