Asp newbie

S

Simon

I'm coming from a php / coldfusion background, and while most things
look straigtforward, I'm puzzeled by a couple of things

Drag and drop tools are great, but what happens when I want the
following to happen

Two drpodowns , DDa and DDb are both databound to tables in a
database. When DDa's selected value changes, DDb's items are reduced.

Do I need to code behind and "manually" add/remove items from DDb?
Is there some way I can do this without coding behind?

If I change DDb to a radio list, would this change the way I
repopulate it?
 
C

Chad Scharf

Are you using the SqlDataSource or ObjectDataSource control for databinding?
If so, you should be able to add an <asp:ControlParameter ControlID="DDa" />
in your <SelectParameters> collection or add this "Where..." clause in the
datacontrol designer. Then just set the AutoPostBack="true" on the first drop
down list, handle the SelectedIndexChanged event and call DDb.DataBind().

Both RadioButtonList and DropDownList are both use the same construct for
storing and enumerating ListItems. Therefore if you wanted to change the
control type, your datasources, and even code-behind event handler could
remain the same.
 
C

Chad Scharf

Are you using the SqlDataSource or ObjectDataSource control for databinding?
If so, you should be able to add an <asp:ControlParameter ControlID="DDa" />
in your <SelectParameters> collection or add this "Where..." clause in the
datacontrol designer. Then just set the AutoPostBack="true" on the first drop
down list, handle the SelectedIndexChanged event and call DDb.DataBind().

Both RadioButtonList and DropDownList are both use the same construct for
storing and enumerating ListItems. Therefore if you wanted to change the
control type, your datasources, and even code-behind event handler could
remain the same.
 

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

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,188
Latest member
Crypto TaxSoftware

Latest Threads

Top