使用的应用程序:Visual Studio 2010(vb)
使用的语言:Visual Basic + asp
案例:我在填充动态复选框字段时遇到问题
示例脚本:
<tr>
<td style="width: 40%; height: 50%">
<!-- added Panel to show vertical scrollbar -->
<asp:Panel ID="Panel2" runat="server" ScrollBars="Vertical" Height="80%">
<asp:CheckBoxList ID="cblSub" runat="server" DataSourceID="SqlDataSource1"
DataTextField="SubName" DataValueField="SubName">
</asp:CheckBoxList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:CLMDBconnectionString %>"
SelectCommand="SELECT * FROM [app_subscription] WHERE deleted = 'N' ">
</asp:SqlDataSource>
</asp:Panel>
</td>
<td style="width: 40%; height: 50%">
<!-- added Panel to show vertical scrollbar -->
<asp:Panel ID="Panel1" runat="server" ScrollBars="Vertical" Height="80%">
<asp:CheckBoxList ID="cblsubitem" runat="server" DataSourceID="SqlDataSource2"
DataTextField="SubitemName" DataValueField="SubitemName">
</asp:CheckBoxList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:CLMDBconnectionString %>"
SelectCommand="
Select app_subscriptionItem.SubItemName
FROM [CLMDB].[dbo].[app_subscriptionType]
Join app_subscriptionItem ON app_subscriptionItem.SubItemID = [app_subscriptionType].SubItemID
WHERE [SubID] = @SubID
END
">
<selectparameters>
<asp:controlparameter name="SubID" controlid="cblsubitem" propertyname="SelectedValue"/>
</selectparameters>
</asp:SqlDataSource>
</asp:Panel>
</td>
我想做的结果: