C#文本框判断是否为空

来源:百度知道 编辑:UC知道 时间:2024/06/08 06:05:09
Label labela = (Label)DataList3.Items[i].FindControl("Labela");
Label labelb = (Label)DataList3.Items[i].FindControl("Labelb");
RadioButtonList rbl3 = (RadioButtonList)DataList3.Items[i].FindControl("RadioButtonList1");
if (rbl3.SelectedItem.Value.ToString() == null)主要是if语句如何判断文本框未空,文本框是在DataList模板中
{
labela.Visible = false;
labelb.Visible = true;
}
else
{
String StrAnswer = rbl3.SelectedItem.Value.ToString();
int id = Convert.ToInt16(DataList3.DataKeys[i].ToString());
String StrSql = "select f_answer from fill where f_id='" + id + "'";
String StrRightAnswer = t.Select(StrSql).Tables[0].Rows[0][0].ToString();
if (StrAnswer == StrRightAnswer)
{

if (rbl3 is RadioButtonList )
{
if(rdl3.SelectedItem != null)
{
labela.Visible = false;
labelb.Visible = true;

}
}

lz,请正确认识什么是文本框时再提问好吗?

文本框???

哪有文本框!

TextBox啊.

找不到...