Change SelectCommand through DropDownList

Discussion in '.NET' started by Quindoo, May 26, 2010.

  1. Quindoo

    Quindoo

    Joined:
    May 26, 2010
    Messages:
    1
    Dear Velocity,

    I am working on a project which involves ASP.NET, C# and ORACLE.

    I've got a page which has a DropDownList, a SqlDataSource and a Repeater.
    The repeater is connected with the SqlDataSource and the DropDownList has different options.

    The DropDownList shows the status of a PURCHASE ORDER, which can be set to either Ordered, Canceled and Delivered. By selecting one of these options, I would like to reload the page and change the SelectCommand of the SqlDataSource so that the Repeater shows different data connected with the status that is selected.

    I've already tried several things but I can't seem to fix it.
    I am currently on my work, so I'll post the code that I've tried later this day.

    I hope someone knows how to set this up right.

    Thanks in advance,

    Quindoo

    Edit: I found the solution myself after trying out alot of things, I came to the conclusion that I was thinking to hard to solve it.
    The solution for me was:

    Attach an OnTextChanged to the dropdownlist and add an if / else if / else statement within the code in the code behind. Simular to If dropdownlist.text == 'My First Value' then SqlDataSource1.SelectCommand = ....' etc..
     
    Last edited: May 27, 2010
    Quindoo, May 26, 2010
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shenc
    Replies:
    3
    Views:
    14,581
    ivanxie
    Dec 21, 2012
  2. prontoo
    Replies:
    0
    Views:
    689
    prontoo
    Dec 13, 2005
  3. G. Whiz

    spit out SelectCommand

    G. Whiz, Mar 1, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    395
    Jim Andersen
    Mar 7, 2006
  4. mlfblom@gmail.com
    Replies:
    0
    Views:
    993
    mlfblom@gmail.com
    Dec 2, 2006
  5. David C

    Change SelectCommand

    David C, Oct 11, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    372
    David C
    Oct 11, 2007
Loading...

Share This Page