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}honeTextBox
runat=server></{0}honeTextBox>")]
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:
<eTowerhoneTextBox id="cPhone" runat="server" Width="280px" Font-
Names="Tahoma" Font-Size="8pt"></eTowerhoneTextBox>
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.
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}honeTextBox
runat=server></{0}honeTextBox>")]
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:
<eTowerhoneTextBox id="cPhone" runat="server" Width="280px" Font-
Names="Tahoma" Font-Size="8pt"></eTowerhoneTextBox>
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.