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