public void smallclass_Update(object sender, DataGridCommandEventArgs e) 
{

string name = ((TextBox)e.Item.Cells[1].Controls[1]).Text;
string Trade_Apply_Big_Class_ID = ((DropDownList)e.Item.FindControl("parentname")).SelectedItem.Value;
}
我想实现当name 和Trade_Apply_Big_Class_ID的值为空时,弹出警告信息!!

解决方案 »

  1.   

    判断一下不就完了   
    if(e.Item.FindControl("parentname")).SelectedItem.Value=="") 
    {
          
    }
      

  2.   

    按上楼的,再加上:
    HttpContext.Current.Response.Write("<script language='javascript'>alert('不能为空')</script>");
      

  3.   

    if(e.Item.FindControl("parentname")).SelectedItem.Value=="") 
    {
     Page.RegisterClientScriptBlock("message","<script language=javascript>alert('警告信息')</script>");
          
    }
      

  4.   

    Response.Write("<script for=window event=onload>window.alert('Wrong!');</" & "script>")
      

  5.   

    if(name ==""&&Trade_Apply_Big_Class_ID="")
    {
     //alert
    }