We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

MaskedEditTextBox Problem

Thread ID:





93692 Mar 29,2010 07:43 PM UTC Apr 15,2010 04:58 AM UTC ASP.NET Web Forms (Classic) 5
Tags: Tools
Asked On March 29, 2010 07:43 PM UTC

hello good afternoon.

I have a problem with a type MaskedEditTextBox ItemTemplate.
I have this element in a ToolBar with other Componenet.
The problem is I can not get the value that is written in this
mask field. The same toolbar I have a normal textbox, this element
I get the value that is easily written as follows:

texto = ((TextBox)(Barra1.Controls[1].Controls[1].FindControl("txtBox1"))).Text;

But to find the value of MaskedEditTextBox always returns empty.

texto = ((Syncfusion.Web.UI.WebControls.Shared.MaskedEditTextBox)(Barra1.Controls[1].Controls[1].FindControl("txtMaskNumeric"))).Value;

As commentary, the Toolbar is a component that I created and use it in all my pages.

Lakxman Kumar C [Syncfusion]
Replied On April 5, 2010 01:19 PM UTC

Hi Rodrigo,

Thank you for your interest in Syncfusion Products.

When the maskedit is inside the Toolbar as template, the ID will be generated on the fly. So, the maskedit can only be accessed by iterating the template list for the presence of the maskedit text box and its 'Text' property will give the text of the MaskEditTextbox. Please try this and let me know if any concerns.

Lakxman Kumar C

Replied On April 5, 2010 05:33 PM UTC

The property 'Text' also returns empty.

Replied On April 5, 2010 06:39 PM UTC

Sorry. Misunderstood the first time. How do I scan the components of the toolbar?

Replied On April 5, 2010 06:58 PM UTC

foreach (Control control in Barra1.Controls[1].Controls[1].Controls)
if (control is Syncfusion.Web.UI.WebControls.Shared.MaskedEditTextBox)
String fr=((Syncfusion.Web.UI.WebControls.Shared.MaskedEditTextBox)control).Text;

I find the component, but the property 'Text' me back empty. I have to scan or otherwise?

Lakxman Kumar C [Syncfusion]
Replied On April 15, 2010 04:58 AM UTC

Hi Rodrigo,

Thank you for your update.

The MaskEditTextBox added as a template control can be accessed by calling the button click method at the MaskEditTextBox's onLoad and then casting the sender as MaskEditTextBox. From then the Text property of the template mask edit can be obtained using the 'Text' property. Kindly refer the code snippet below.


protected void Button1_Click(object sender, EventArgs e)
if (sender.GetType().FullName != "System.Web.UI.WebControls.Button")
mymask = sender as MaskedEditTextBox;
Label1.Text = mymask.Text;

Kindly try the above code and please let me know if you have any other queries.

Lakxman Kumar C


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon