我试着这样写DropDownList1.Items.FindByText("ee").Selected=true; 可出现了如下错误:Object reference not set to an instance of an object.怎么办?
For I = 0 To seldec.Items.Count - 1 If seldec.Items(I).Text = myFunc.myIsNull(MyTab.Rows(0).Item("c_job_description")) Then seldec.Items(I).Selected = True End If Next
{
Label1.Text=DropDownList1.SelectedItem.Value+":"+DropDownList1.SelectedItem.Text+"==="+DropDownList1.SelectedIndex;
}==============
DropDownList1.SelectedIndex:匹配的项的index的值
可出现了如下错误:Object reference not set to an instance of an object.怎么办?
If seldec.Items(I).Text = myFunc.myIsNull(MyTab.Rows(0).Item("c_job_description")) Then
seldec.Items(I).Selected = True
End If
Next