Databinding expressions are only supported on objects that have a DataBinding event

Discussion in 'ASP .Net' started by jobs, Sep 26, 2007.

  1. jobs

    jobs Guest

    I have this function that checks the current status of checkbox. It
    works great on almost all my controls. I use to determine if I will
    make certain textboxes and labels visible.

    However, when I attempt to use it to disable certain items in a
    dropdownlist, I get this error:

    Parser Error Message: Databinding expressions are only supported on
    objects that have a DataBinding event.
    System.Web.UI.WebControls.ListItem does not have a DataBinding event.


    I'm trying to use it as follows:

    <asp:ListItem Value="RT-RECHARGE" Enabled='<%# CashorCredit()%>'>$20
    OFF NEXT RECHARGE</asp:ListItem>
    </asp:DropDownList><br />




    It's works when I use here:

    <asp:TextBox ID="cityTextBox" maxlength="20" Visible='<%#
    CashorCredit()%>' runat="server" SkinID="Retailer"
    Text='<%# Bind("city") %>' Width="149px" />
    <br>

    Thanks for any help or information.
     
    jobs, Sep 26, 2007
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.