Asp newbie

  • Thread starter Thread starter Simon
  • Start date Start date
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?
 
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.
 
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.
 
Back
Top