Dynamic Dropdown Ecommerce

Last post 04-08-2008 2:30 PM by NiPsTeR. 6 replies.

Sort Posts:

  • Dynamic Dropdown Ecommerce

    04-08-2008, 8:00 AM
    • Loading...
    • NiPsTeR
    • Joined on 08-07-2006, 5:23 PM
    • Posts 24

    Apologies if this has been posted several times before however i cannot find this within the search.

    Here is my scenario:
     
    For each product in my ecommerce website i need to dynamically create dropdown and populate them for each product dependant on the attributes assigned to them.

    e,g

    Colour
    Size
    etc etc

    Some product will not have any, and some product will have more than two options. I have succesfully created the database structure i believe i need, i just need help creating the dropdown control dependant on the number of attributes (colour,size) assigned to the product.

    Can anyone help ?

     

    Filed under: , ,
  • Re: Dynamic Dropdown Ecommerce

    04-08-2008, 8:19 AM
    • Loading...
    • Joël Hébert
    • Joined on 07-20-2005, 6:07 PM
    • Ottawa Canada
    • Posts 614

    create a dataview ordered on colour and size it will do the trick

     

    what you do is get a dataset of all the items in the db that match the part, then use a dataview to order them correctly.

     

    my 2 cents

     

    Joël Hébert

    ASP.NET Consultant
    Opulent ASP Development Inc.
    www.opulentasp.com
    Ottawa,Canada

    Click "Mark as Answer" on the posts that helped you to help future readers to get the solutions
  • Re: Dynamic Dropdown Ecommerce

    04-08-2008, 8:49 AM
    • Loading...
    • NiPsTeR
    • Joined on 08-07-2006, 5:23 PM
    • Posts 24

    apologies i am guessing i didnt explain correctly.

    I can happily populate a dropdown with data from the database however i need to create the dropdown control dynamically i.e some products will have 2-3 dropdowns, some product could have 1-2 dropdowns containing the values of the attribute (whatever that attribute may be)

    Hope this helps
     

  • Re: Dynamic Dropdown Ecommerce

    04-08-2008, 10:00 AM
    • Loading...
    • Joël Hébert
    • Joined on 07-20-2005, 6:07 PM
    • Ottawa Canada
    • Posts 614

    create teh control at runtime based on values

    iterate your data if it has attributes you load the control....ddlist

     Me.Controls.Add(Me.LoadControl(Virtual))

    Joël Hébert

    ASP.NET Consultant
    Opulent ASP Development Inc.
    www.opulentasp.com
    Ottawa,Canada

    Click "Mark as Answer" on the posts that helped you to help future readers to get the solutions
  • Re: Dynamic Dropdown Ecommerce

    04-08-2008, 10:10 AM
    Answer
    • Loading...
    • paindaasp
    • Joined on 12-19-2007, 12:47 PM
    • Exit 3
    • Posts 147

    Perhaps this will be of some help:

    http://www.asp.net/learn/ajax-videos/video-77.aspx

     

     

  • Re: Dynamic Dropdown Ecommerce

    04-08-2008, 10:22 AM
    Answer

    Create a Runtime control like

    dropdownlist  ddl  = new dropdownlist();

    ddl.datasource = Ds ( your dataset or Data reader)

    ddl.Datatextfield ="xxx" (your attribute to display to  user)

    ddl.datavaluefield  = "yyy" ( value shoud pass to server)

    me.controls.add(me.loadControl(ddl));

     

    I hope this will help you.

     

  • Re: Dynamic Dropdown Ecommerce

    04-08-2008, 2:30 PM
    • Loading...
    • NiPsTeR
    • Joined on 08-07-2006, 5:23 PM
    • Posts 24
    Thank you for your help so farhowever i am still having problems, would it be possible if anyone can provide me with a working example. 

    if it helps this guy explains better: http://forums.asp.net/p/346743/346743.aspx     in a previous post.

     Thanks
     

Page 1 of 1 (7 items)
Microsoft Communities
Page view counter