Asp newbie

Asp newbie

am 17.01.2008 17:59:42 von 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?

RE: Asp newbie

am 17.01.2008 22:44:02 von chad

Are you using the SqlDataSource or ObjectDataSource control for databinding?
If so, you should be able to add an
in your 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.

--
Chad Scharf
_______________________________
http://www.chadscharf.com


"Simon" wrote:

> 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?
>
>

RE: Asp newbie

am 17.01.2008 22:45:00 von chad

Are you using the SqlDataSource or ObjectDataSource control for databinding?
If so, you should be able to add an
in your 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.

--
Chad Scharf
_______________________________
http://www.chadscharf.com


"Simon" wrote:

> 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?
>
>