I can imagine many ways of implemeting search features in an ASP.NET MVC application but since I can't find much documentation I was wondering if you have any common pattern, technology or common approach to implement search features in a ASP.NET MVC application (similar to stackoverflow). Some technologies that I have in mind are:
...but what is the best approach to integrate them with ASP.NET MVC?
Ideas?
Right-click on the controller folder then select Add -> controller. Select MVC 5 Controller with read/write actions and click Add. Provide the controller a name. Click Add.
Right click on Index method and select Strong -typed view as shown in the following figure. In above code I have two html radiobutton and one html text box and simple submit Button. Press F5 and run you application. Here I have checked the name Radiobutton and searched name starting from S alphabet.
The Search functionality will be implemented using a Stored Procedure which will be called by passing the parameter value using Entity Framework in ASP.Net MVC 5 Razor. Here I am making use of Microsoft’s Northwind Database.
The Search functionality will be implemented using a Stored Procedure which will be called by passing the parameter value using Entity Framework in ASP.Net MVC 5 Razor. Here I am making use of Microsoft’s Northwind Database. You can download it from here. You will need to create the following Stored Procedure in the Northwind Database.
Provide a meaningful name and click OK. Select an empty template and choose the type as MVC for the ASP.Net project. Once you click OK, a blank ASP.Net MVC application will be created.
In our web applications in MVC, we often need to add the functionality to search the database objects for specific data based on some criteria like to find employees with name starting with 'N' or to find data of employees that have Gender Male. * Open Microsoft SQL server. Click on New Query. Now execute the query below to create database.
It's not entirely clear what you are specifically asking, but, in general:
I believe in one of his blog posts Jeff Atwood talks about how he used sitemaps in order to let google handle most of the searching capabilities on stack overflow. Why write your own searching algorithms when people are likely just going to use google anyway?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With