Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Custom control in ASP.NET 1.1.432 issue

Reply
Thread Tools

Custom control in ASP.NET 1.1.432 issue

 
 
SenseiHitokiri
Guest
Posts: n/a
 
      03-13-2007
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom control within a custom control J R M ASP .Net 2 06-01-2006 06:04 PM
Capturing event from other custom control within another custom control Jonah Olsson ASP .Net 1 04-05-2005 01:39 PM
Capturing event from other custom control within another custom control Jonah Olsson ASP .Net Web Controls 2 04-05-2005 12:56 PM
ControlDesigner not invoked on custom control when control is rendered within another custom control Matt Sokol ASP .Net Building Controls 2 08-07-2003 07:13 AM
Using Table control in a custom composite control. Control does not render properly in design time. jb_in_marietta@yahoo.com ASP .Net 0 07-01-2003 09:26 PM



Advertisments