B
Bogdan
Hi,
I have a CheckBoxList on a page and an Object Data Source which expects
values from the list as its select parameters. Is there a way to
declaratively define select parameters to reference items in the check box
list?
Example:
<asp:CheckBoxList ID="cblTypes" runat="server" AutoPostBack="True"
RepeatDirection="Horizontal" RepeatLayout="Flow" CssClass="legend"
onselectedindexchanged="cblTypes_SelectedIndexChanged">
<asp:ListItem Selected="True" Value="1">Type1</asp:ListItem>
<asp:ListItem Value="2">Type2</asp:ListItem>
<asp:ListItem Value="1">Type3</asp:ListItem>
</asp:CheckBoxList>
[...]
<asp:ObjectDataSource ID="odsElements" runat="server"
OldValuesParameterFormatString="{0}"
SelectMethod="GetElementsByUserId" TypeName="ElementsBLL">
<SelectParameters>
<asp:SessionParameter Name="userId" SessionField="UserId" Type="String" />
[...]
</SelectParameters>
</asp:ObjectDataSource>
The BLL's select method has the following signature:
public Elements.ElementDataTable ElementsBLL.GetElementsByUserId(string
userId, short type1, short type2, short type3)
If this cannot be done declaratively then what is the best approach if the
ODS provides data to a GridView control?
Thanks,
Bogdan
I have a CheckBoxList on a page and an Object Data Source which expects
values from the list as its select parameters. Is there a way to
declaratively define select parameters to reference items in the check box
list?
Example:
<asp:CheckBoxList ID="cblTypes" runat="server" AutoPostBack="True"
RepeatDirection="Horizontal" RepeatLayout="Flow" CssClass="legend"
onselectedindexchanged="cblTypes_SelectedIndexChanged">
<asp:ListItem Selected="True" Value="1">Type1</asp:ListItem>
<asp:ListItem Value="2">Type2</asp:ListItem>
<asp:ListItem Value="1">Type3</asp:ListItem>
</asp:CheckBoxList>
[...]
<asp:ObjectDataSource ID="odsElements" runat="server"
OldValuesParameterFormatString="{0}"
SelectMethod="GetElementsByUserId" TypeName="ElementsBLL">
<SelectParameters>
<asp:SessionParameter Name="userId" SessionField="UserId" Type="String" />
[...]
</SelectParameters>
</asp:ObjectDataSource>
The BLL's select method has the following signature:
public Elements.ElementDataTable ElementsBLL.GetElementsByUserId(string
userId, short type1, short type2, short type3)
If this cannot be done declaratively then what is the best approach if the
ODS provides data to a GridView control?
Thanks,
Bogdan