Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. datalist with embedded dropdownlist question 2.) [solved]

datalist with embedded dropdownlist question 2.) [solved]

Scheduled Pinned Locked Moved ASP.NET
questioncsharphtmldatabasedesign
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Crapaw45
    wrote on last edited by
    #1

    I have a datalist which includes an embedded dropdownlist. The datalist is similar to a simple shopping cart. The dropdownlist is the qty required. I've been able to set the extend price etc, but I'm also trying to set the selected qty of this dropdownlist. It doesn't seem to like any embedded <%# eval()%> in the html. The qty is updated in the database and is returned. This is the html: =================================================================== <asp:DropDownList ID="ddlQty" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlQty_Changed" > <asp:listitem runat="server" value="1" Selected='<%# Eval("itemqty")==1 %>' /> <asp:listitem runat="server" value="2" Selected='<%# Eval("itemqty")==2 %>' /> <asp:listitem runat="server" value="3" Selected='<%# Eval("itemqty")==3 %>' /> <asp:listitem runat="server" value="4" Selected='<%# Eval("itemqty")==4 %>' /> <asp:listitem runat="server" value="5" Selected='<%# Eval("itemqty")==5 %>' /> asp:DropDownList ==================================================================== Error: Databinding expressions are only supported on objects that have a DataBinding event. System.Web.UI.WebControls.ListItem does not have a DataBinding event. Any ideas?:confused: For referenc, my initial C# question was on 11/5/2009. Used C# to update the selected value while looping thru the dataset and the datalist.:thumbsup:

    modified on Thursday, November 12, 2009 3:29 PM

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups