Advance Searching concept using ASP.NET Web Form

188 views Asked by At

Advance Searching concept using ASP.NET Web Form, I need like below URL type requirement.

https://www.naukri.com/top-company-jobs

I tried below SqlDataSource but when I fill all text boxes then only Its search sorting. I need if any of textbox type something then search should work. I do not know I have to write algorithm or any stored procedure.

 <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>
0

There are 0 answers