Custom control in ASP.NET 1.1.432 issue



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.

.



Relevant Pages

  • Re: Enumerated List of Formats
    ... The user would be setting a property on my custom textbox user control. ... The last thing the control does is set the format to what is desired once ... Private Enum tbFormat ...
    (microsoft.public.vb.general.discussion)
  • Re: (HW) Adding custom controls within a project
    ... > Click the OK button and the control will be added to the toolbox. ... > Reset inheritance back to TextBox, ... >> custom textBox on a form now. ...
    (microsoft.public.dotnet.languages.csharp)
  • (HW) Adding custom controls within a project
    ... I have created a custom textBox within a C# project. ... Add a User Control to the Project ... protected override void OnDragEnter ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: auto tab from textbox
    ... control. ... How did I get reference to the other controls on the form from this custom textbox? ... Happy coding! ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • RE: Calculated fields in Form - Design view
    ... the separate fields is probably the way to go. ... Input mask for the time field 99:00>LL ... >> First, to accomodate existing records and display the count, we need to put ... >> (Pass it the name of the control you are calling from so it knows what to do.) ...
    (microsoft.public.access.forms)