Updating records using linq
NET MVC workshop where we discussed several advantages of using j Query in MVC.During the session, one of the attendee wanted to know how to filter data in the ‘Index’ view based upon the matching search string passed from the view.In this article, we will see a simple solution for this problem. NET MVC: Displaying Partial Views using j Query UI Dialog Boxes and Using j Query for displaying ASP.
This will show the Employee data in the Tabular fashion.This will add a new ‘New Employee’ folder as a subfolder of Views folder in the Project and the Index.cshtml in it.Step 4: Right-Click on the New Employee folder and add a new strongly-typed partial view which has Model class as Employee Info and the scaffold template as ‘List’. Note that the Index method with Http Post returns this partial View.Step 5: Open Index.cshtml and add a new Html Text box and the div tag as below: Enter the Emp Name to Filter: The Keyup event of the textbox is used to trigger an Async Postback.When the text is entered in the textbox the table ‘tbl Data’ is hidden and the ‘emp Info Details’ div tag is made visible.
The event makes an asynchronous POST to the Http Post Index method of the New Employee controller and gets the Partial View as a response. If the Text Box has no text, then all records will be displayed by making tbl Data visible again.