页面上    <asp:DropDownList ID="DropDownList1" runat="server" Height="23px" Width="105px">
有这样一个List在.cs文件里为什么报does not contain a definition这个list这样的错啊?

解决方案 »

  1.   

        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.DropDownList1.Text.ToString() == "Others")
            {
                this.DropDownList4.Visible = false;
            }
        }
    代码是这样
      

  2.   

    this.DropDownList4.Visible = false; 
    有DropDownList4吗????
      

  3.   

    DropDownList1
    DropDownList4
    报这两个都不存在啊...
    其实页面上都有啊...
      

  4.   

    //this.DropDownList1.Text.ToString() 
    this.DropDownList1.SelectedItem.Text.ToString() 
      

  5.   

    Error 1 'FAERequest' does not contain a definition for 'DropDownList1' C:\Documents and Settings\xichen\WebSite1\FAERequest.aspx.cs 22 14 C:\...\WebSite1\
      

  6.   

    你这个错是因为DropDownList的问题吗??
    别的地方?
      

  7.   

    我this. 能点出来啊        if (this.DropDownList1.Text == "Others")
            {
                this.DropDownList4.Visible = false;
            }
     报这两个list没定义啊...     
      

  8.   

    见鬼了~~
    this.DropDownList1.Text 输出看看~~ 
      

  9.   

     Response.Write(this.DropDownList1.Text);编译通不过啊...还是一样的错..
      

  10.   

    或许是你页面里的问题,<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>指定的和你的.aspx对应码?