定義的一個實例中使用:C#,ASP.NET - 的NullReferenceException - 對象引用不設置爲變量的對象
Guid fldProId = (Guid)ffdPro.GetProperty("FieldId");
string fldProValue = (string)ffdPro.GetProperty("FieldValue");
FormFieldDef fmProFldDef = new FormFieldDef();
fmProFldDef.Key = fldProId;
fmProFldDef.Retrieve();
string fldProName = (string)fmProFldDef.GetProperty("FieldName");
string fldProType = (string)fmProFldDef.GetProperty("FieldType");
線爲有問題的(特別是第4行(hTxtBox.Text = ... )):
if (fldProType.ToLower() == "textbox")
{
Label hTxtBox = (Label)findControl(fldProName);
hTxtBox.Text = fldProValue;
}
所有數據從數據庫中正確雲集,但是標籤去扭曲。有任何想法嗎?