一个operation类:operation op = new operation();
txtTitle.Text = op.Rtitle(DropDownList2.SelectedItem.Text.Trim());//未将对象引用设置到对象的实例这是为什么呢!~?
应该怎样改呢?
txtTitle.Text = op.Rtitle(DropDownList2.SelectedItem.Text.Trim());//未将对象引用设置到对象的实例这是为什么呢!~?
应该怎样改呢?
txtTitle.Text=op.Rtitle.ToString();
Rtitle 是一个方法来的
DropDownList2有数据的,它绑定了SQL的一个列的值!
operation op = new operation(); DropDownList a;
ListItem b;
String c;
String d; a = DropDownList1;
b = a.SelectedItem;
c = b.Text;
d = c.Trim;txtTitle.Text = op.Rtitle(d);看看哪行错
operation op = new operation();
if(DropDownList2.SelectedItem != null)
txtTitle.Text = op.Rtitle(DropDownList2.SelectedItem.Text.Trim
else
txtTitle.Text = "";
但我在页面也确实可以读出DropDownList2.SelectedItem 是有值的。。
我想是,没默认值之类的。。是不是应该在DropDownList2的属性中设置点什么呢?!?