<%#DataBinder.EvalContainer.DataItem, "AuthorityID")%>
少了括号
应为
<%#DataBinder.Eval(Container.DataItem, "AuthorityID")%>

解决方案 »

  1.   

    <asp:DropDownList "DropDownList1"Runat="server"></asp:DropDownList>To
    <asp:DropDownList id="DropDownList1" Runat="server"></asp:DropDownList>
      

  2.   

    <%#DataBinder.EvalContainer.DataItem, "AuthorityID")%>--><%#DataBinder.Eval(Container.DataItem, "AuthorityID")%>
    <asp:DropDownList "DropDownList1"Runat="server"></asp:DropDownList>--><asp:DropDownList id="DropDownList1" Runat="server"></asp:DropDownList>
      

  3.   

    你们说的不是阿
    aspx代码是没有错的,那时我站体的时候弄错的,主要是给值得时候!
      

  4.   

    jxufewbt 你写得我不明白阿
      

  5.   

    要是aspx给错的话,应该有提示阿,但是我上面没有!
      

  6.   

    ddl.DataSource = ds.Tables["table1"];出错!
    オブジェクト参照がオブジェクト インスタンスに設定されていません。
      

  7.   

    <EditItemTemplate>
      <asp:DropDownList id="DropDownList1"Runat="server" DataSource=<%#DataBindTable()%> DataTextField="AuthorityID" DataValueField ="AuthorityID"></asp:DropDownList>
    </EditItemTemplate>
    後台
    public object DataBindTable()
    {
     string StrConnection = "server=.;database=DBFILE;trusted_connection = yes";
            SqlDataAdapter da = new SqlDataAdapter("select distinct(AuthorityID) from usertbl", StrConnection);
            DataSet ds = new DataSet();
            da.Fill(ds, "table1");
    return ds.Tables["table1"];
    }
    這樣試試
      

  8.   

    パーサー エラー 
    説明: この要求の処理に必要なリソースの解析中にエラーが発生しました。以下の解析エラーの詳細を確認し、ソースファイルに変更を加えてください。 パーサー エラー メッセージ: サーバー タグが正しく形成されていません。ソース エラー: 
    行 95:                         
    行 96:                          <%--<asp:DropDownList ID=--%>"DropDownList1" Runat="server"></asp:DropDownList>
    行 97:                          <asp:DropDownList id="DropDownList1"Runat="server" DataSource=<%#DataBindTable()%> DataTextField="AuthorityID" DataValueField ="AuthorityID"></asp:DropDownList> 
      

  9.   

    看不懂日文.....   <%--<asp:DropDownList ID=--%>"DropDownList1" Runat="server"></asp:DropDownList>
    <asp:DropDownList id="DropDownList1"Runat="server" DataSource=<%#DataBindTable()%> DataTextField="AuthorityID" DataValueField ="AuthorityID"></asp:DropDownList>                       To
     <asp:DropDownList id="DropDownList1"Runat="server" DataSource=<%#DataBindTable()%> DataTextField="AuthorityID" DataValueField ="AuthorityID"></asp:DropDownList>
      

  10.   

    还是出错,但使我怀疑是找dropdownlist的时候出错,但是我不知道怎么改,原来的aspx是这样的:
                            <asp:TemplateColumn HeaderText="AuthorityID">
                           
                            <ItemTemplate>
                                <%# DataBinder.Eval(Container.DataItem, "AuthorityID")%>
                            </ItemTemplate>
                            
                            <EditItemTemplate>
                            
                             <asp:DropDownList ID="DropDownList1" Runat="server"></asp:DropDownList>
                             </asp:DropDownList>
                             </EditItemTemplate>                        </asp:TemplateColumn>
      

  11.   

    DropDownList ddl= (DropDownList)e.Item.FindControl("DropDownList1");
     看看这个 ddl 是不是空的啊,根本没有找到这个控件