Custom control in ASP.NET 1.1.432 issue

Discussion in 'ASP .Net' started by SenseiHitokiri, Mar 13, 2007.

  1. 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.
     
    SenseiHitokiri, Mar 13, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jonah Olsson
    Replies:
    1
    Views:
    602
    Scott Allen
    Apr 5, 2005
  2. J R M
    Replies:
    2
    Views:
    444
    Charlie@CBFC
    Jun 1, 2006
  3. AleXmanFree
    Replies:
    3
    Views:
    591
    Hillbilly
    Oct 9, 2008
  4. Matt Sokol
    Replies:
    2
    Views:
    411
    Theo Tillotson
    Aug 7, 2003
  5. Srikar
    Replies:
    1
    Views:
    153
    Brock Allen
    Apr 19, 2005
Loading...

Share This Page