Custom control in ASP.NET 1.1.432 issue

S

SenseiHitokiri

I am trying to create a custom textbox that has an input mask to show
the text as a phone number. I am very new to this language and trying
to figure out how these pages relate. I thought I had this set up but
the control appears in an odd manner. It is supposed to just be an
inherited textbox control but instead in the design window it shows up
as black text like this [ myCustomControl ] in bold. It does not
appear at all on the page and is completely neglected from the HTML.

here is my codebehind page:

using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;

namespace TransComp.eTower.Controls
{
/// <summary>
/// Custom Phone textbox that will mask to (###)###-####.
/// </summary>
[DefaultProperty("Text"), ToolboxData("<{0}:phoneTextBox
runat=server></{0}:phoneTextBox>")]
public class PhoneTextBox : System.Web.UI.WebControls.TextBox
{
/// <summary>
/// Render this control to the output parameter specified.
/// </summary>
/// <param name="output"> The HTML writer to write out to </param>
protected override void Render(HtmlTextWriter output)
{

output.Write(Text);
}
}
}

I register the control in my aspx page with this directive:
<%@ Register TagPrefix="eTower" Namespace="TransComp.eTower.Controls"
Assembly="eTower" %>


and then use this to call it:
<eTower:phoneTextBox id="cPhone" runat="server" Width="280px" Font-
Names="Tahoma" Font-Size="8pt"></eTower:phoneTextBox>

Can anyone see what I am doing wrong? I have been working on it now
for some time and I'm running out of ideas. Maybe this is not
supported in 1.1.432 and only in 2.0? Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top