各位大侠,如何实现dropdownlist数据双向绑定
<asp:dropdownlist id="id1" selectedvalue='<%# bind("cj") %>' ruant="server">
<listitem value="Y">cj</listitem>
<listitem value="N">fcj</listitem>
</dropdownlist>
这样怎么提示选择的值没有呀,我看了一下,cj="Y"这个dropdownlist我是放在formview的edit模板列里 

解决方案 »

  1.   

    <asp:dropdownlist id="id1" ruant="server">
    <listitem value="Y" selectedvalue='<%# bind("cj") %>' >cj</listitem>
    <listitem value="N">fcj</listitem>
    </dropdownlist>
      

  2.   

    就应该写到上面的,呵呵,写到<listitem value="Y" selectedvalue='<%# bind("cj") %>' >cj</listitem>这里是不正确的
      

  3.   

    <asp:DropDownList ID="ddl" runat="server" DataSource=" <%# ddlDepartmentBind() %>" DataTextField="deptname" DataValueField="deptname" SelectedValue=' <%# Bind("deptname") %>'>