0
我需要从Web窗体上的文本框中获取文本值。在文档中提到System.Web.UI.WebControl.Textbox有一个属性Text,但是当我尝试使用它时出现错误。System.Web.UI.WebControl.Textbox不包含文本的定义
string FieldName= "";
string FieldValue="";
if (inputValues[i] is System.Web.UI.WebControls.TextBox)
{
FieldName = inputValues[i].ClientID;
FieldValue = inputValues[i].Text; // error
}
显示的错误是System.Web.UI.WebControl.Textbox does not contain the definition of Text
。如何从文本框控件获取文本值?
什么是inputValues类型? – Adil