使用ASP.NET Web Form进行高级搜索概念,我需要以下URL类型要求。
https://www.naukri.com/top-company-jobs
我尝试了下面的SqlDataSource,但是当我填写所有文本框时,只有它的搜索排序。我需要任何文本框类型的东西,然后搜索应该工作。我不知道我必须编写算法或任何存储过程。
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:CRM %>"
SelectCommand ="SELECT FirstName, LastName, Title, City, HomePhone
FROM Employees WHERE
(@FirstName IS NULL OR FirstName LIKE '%' + @FirstName + '%') AND
(@LastName IS NULL OR LastName LIKE '%' + @LastName + '%') AND
(@Title IS NULL OR Title LIKE '%' + @Title + '%') AND
(@City IS NULL OR City LIKE '%' + @City + '%');"
CancelSelectOnNullParameter="False"
>
<SelectParameters>
<asp:ControlParameter
ControlID="txtFirstName"
Name="FirstName"
Type="String" />
<asp:ControlParameter
ControlID="txtLastName"
Name="LastName"
Type="String" />
<asp:ControlParameter
ControlID="txtTitle"
Name="Title"
Type="String" />
<asp:ControlParameter
ControlID="txtCity"
Name="City"
Type="String" />
</SelectParameters>
</asp:SqlDataSource>