我正在使用这个:http ://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/MaskedEdit/MaskedEdit.aspx
在一个列中,我有多个文本框绑定到数据库中的某些列。我的目标是从那些掩码编辑的文本框中获取值。由于列中有 4 个控件,因此我试图获取如下值:
String firstTXT = ((TextBox)(row.Cells[5].Controls[1])).Text;
String SecondTXT = ((TextBox)(row.Cells[5].Controls[2])).Text;
我可以从 firsttexbox 中获取值而没有任何错误(但它也被屏蔽了)。当我尝试从第二个开始时,我得到:
Unable to cast object of type 'AjaxControlToolkit.MaskedEditExtender' to type 'System.Web.UI.WebControls.TextBox'
。
有机会解决吗?谢谢