Link to home
Start Free TrialLog in
Avatar of csaexperts
csaexpertsFlag for United States of America

asked on

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

ASKER CERTIFIED SOLUTION
Avatar of GiftsonDJohn
GiftsonDJohn
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial