• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 230
  • Last Modified:

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

0
csaexperts
Asked:
csaexperts
1 Solution
 
GiftsonDJohnCommented:
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

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

Tackle projects and never again get stuck behind a technical roadblock.
Join Now