The code example below shows how to populate a RadioButtonList based on the selection made in a DropDownList on which the RadioButtonList depends. The key to your problem is finding the SqlDataSourceID on your Events Calendar page, and making the necessary
modifications. See below:
<asp:ListBox ID="List_ClubMember" runat="server"
DataSourceID="BillingPage_ClubMembers" DataTextField="ClubMember"
DataValueField="ClubMemberID" AutoPostBack="True"></asp:ListBox>
<asp:SqlDataSource ID="BillingPage_ClubMembers" runat="server"
ConnectionString="<%$ ConnectionStrings:YourDatabaseConnectionString %>"
SelectCommand="SELECT [ClubMemberID], [ClubMember] FROM [ClubMembers] ORDER BY [ClubMember]">
</asp:SqlDataSource>
<asp:RadioButtonList ID="RadBtn_Events" runat="server" AutoPostBack="True"
DataSourceID="BillingPage_Events" DataTextField="EventName" DataValueField="EventID"
style="height: 40px; width: 240px">
</asp:RadioButtonList>
<asp:SqlDataSource ID="BillingPage_Events" runat="server"
ConnectionString="<%$ ConnectionStrings:YourDatabaseConnectionString %>"
SelectCommand="SELECT * FROM [Events] WHERE ([ClubMemberID] = @ClubMemberID) ORDER BY [EventName]">
<SelectParameters>
<asp:ControlParameter ControlID="List_ClubMember" Name="ClubMemberID"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
Marked as answer by miesan on Jun 19, 2008 12:50 AM
miesan
Member
5 Points
10 Posts
Drop Down list filter by location : Club site Event Calendar
Jun 18, 2008 08:37 AM|LINK
hi,
i'm newbie in asp.net, recently i have a project for event calendar in asp.net.
i downloaded and installed the clubsite stater kits, seem works n fine.
i want to make some modification regarding event calendar, page Events_Calendar.aspx
1. using Drop down list that has location value.
2. when user select value from drop down list, it will update the events according to the selection.
question: can i do this, or is there any suggestion?
p/s: please someone help me
ASP.NET 2.0
MSSQL 2000
Clubsite starter kit
thanx in advance.
DropdownDownList
Gaucho
Participant
892 Points
240 Posts
Re: Drop Down list filter by location : Club site Event Calendar
Jun 18, 2008 02:11 PM|LINK
The code example below shows how to populate a RadioButtonList based on the selection made in a DropDownList on which the RadioButtonList depends. The key to your problem is finding the SqlDataSourceID on your Events Calendar page, and making the necessary modifications. See below:
<asp:ListBox ID="List_ClubMember" runat="server"
DataSourceID="BillingPage_ClubMembers" DataTextField="ClubMember"
DataValueField="ClubMemberID" AutoPostBack="True"></asp:ListBox>
<asp:SqlDataSource ID="BillingPage_ClubMembers" runat="server"
ConnectionString="<%$ ConnectionStrings:YourDatabaseConnectionString %>"
SelectCommand="SELECT [ClubMemberID], [ClubMember] FROM [ClubMembers] ORDER BY [ClubMember]">
</asp:SqlDataSource>
<asp:RadioButtonList ID="RadBtn_Events" runat="server" AutoPostBack="True"
DataSourceID="BillingPage_Events" DataTextField="EventName" DataValueField="EventID"
style="height: 40px; width: 240px">
</asp:RadioButtonList>
<asp:SqlDataSource ID="BillingPage_Events" runat="server"
ConnectionString="<%$ ConnectionStrings:YourDatabaseConnectionString %>"
SelectCommand="SELECT * FROM [Events] WHERE ([ClubMemberID] = @ClubMemberID) ORDER BY [EventName]">
<SelectParameters>
<asp:ControlParameter ControlID="List_ClubMember" Name="ClubMemberID"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
miesan
Member
5 Points
10 Posts
Re: Drop Down list filter by location : Club site Event Calendar
Jun 19, 2008 12:50 AM|LINK
first i study with the following code, and finally it gives me solution
thanks Gaucho [:D] [Yes]
jack skellin...
Member
2 Points
1 Post
Re: Drop Down list filter by location : Club site Event Calendar
Nov 19, 2008 04:05 AM|LINK