Unable to view the data in DataList after Filtering the values from the dropdown list

Hello Experts,
I am trying to retrieve the values in the datalist after filtering the data from the dropdown list. I am not sure where exactly I am going wrong.Whenever I am trying to select any value from the dropdown list , I am seeing blank page
I am using ASP.net 2.0 with C#, I have created view to retrieve values in the dropdownlist(SQLDatasourse1) and created another view to view the results after selecting the value from the dropdownlist (SQLDatasource2)

Apperciate any help thanks
Here is what I have done
<asp:Content id="Content1" runat="server" contentplaceholderid="ContentPlaceHolder1">
 
	<p style="height: 308px">
	<asp:DropDownList id="DDDate" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource1" DataTextField="LastModificationDate" DataValueField="DepartmentId">
	</asp:DropDownList>
	<asp:SqlDataSource id="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:HelpDeskConnectionString %>" SelectCommand="SELECT * FROM [Title2ViewReportResults] WHERE (([LastModificationDate] = @LastModificationDate)  AND ([DepartmentId] = @DepartmentId))">
		<SelectParameters>
			<asp:controlparameter ControlID="DDDate" Name="LastModificationDate" PropertyName="SelectedValue" Type="String" />
			<asp:controlparameter ControlID="DDDate" Name="DepartmentId" PropertyName="SelectedValue" Type="Int32" />
		</SelectParameters>
	</asp:SqlDataSource>
	<asp:DataList id="DataList1" runat="server" DataSourceID="SqlDataSource2">
		<ItemTemplate>
			DepartmentId:
			<asp:label id="DepartmentIdLabel" runat="server" Text='<%# Eval("DepartmentId") %>' />
			<br />
			ProblemStatusId:
			<asp:label id="ProblemStatusIdLabel" runat="server" Text='<%# Eval("ProblemStatusId") %>' />
			<br />
			LastModificationDate:
			<asp:label id="LastModificationDateLabel" runat="server" Text='<%# Eval("LastModificationDate") %>' />
			<br />
			ProblemStatus:
			<asp:label id="ProblemStatusLabel" runat="server" Text='<%# Eval("ProblemStatus") %>' />
			<br />
			<br />
		</ItemTemplate>
	</asp:DataList>
	<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:HelpDeskConnectionString %>" SelectCommand="SELECT * FROM [Title2ViewReports] ORDER BY [DepartmentId], [LastModificationDate]">
	</asp:SqlDataSource>
	</p>
	
	
</asp:Content>

Open in new window

csaexpertsComputer SpecilaistsAsked:
Who is Participating?
 
GiftsonDJohnConnect With a Mentor Commented:
Hi

You have given same controlid for different parameters

              <SelectParameters>
                        <asp:controlparameter ControlID="DDDate" Name="LastModificationDate" PropertyName="SelectedValue" Type="String" />
                        <asp:controlparameter ControlID="DDDate" Name="DepartmentId" PropertyName="SelectedValue" Type="Int32" />
                </SelectParameters>
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.