Change SelectCommand through DropDownList

Joined
May 26, 2010
Messages
1
Reaction score
0
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:

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top