I have a view in which there is a list.Every record in the list have some child records . When I click on the details link ,I want the records to be displayed in the table below.
What mechanism should I follow to do this ?
I want some way to display the values in table below.
I have a view in which there is a list.Every record in the list
Share
The easiest way to do it would be to call an action that returns a partial view with the record.
If you are using jQuery, the code would be like this:
Wherever you want to show the details, add an empty div:
jQuery code, to include in the head of the document:
Code for the action:
I usually add an extra parameter to the action, to check if the Action has been called using Ajax. If not, instead of the PartialView I return a View that includes the PartialView (I do this for accessibility, and to be sure that the web/app keeps working even if the Javascript failed).