Looking for some samples or references for a specific need in SP13. I am looking for the best way to auto-fill information on a page based on a SPList.
Example: I have a SPList that contains branch location information. I have a BranchInformation.aspx page. I am passing this page a query string of LocationId=<ID>. I need something to query the list and pull all of the data into the page and place the data in the correct areas, etc. I was thinking about using a custom display template but it seems to be overkill for a single search result.
If its just listing of data in OOB list format, i would suggest to drop the listview webpart on branchinformation.aspx page and pass the param FilterField1=<field name>&FilterValue1=<Location Name>. As you know this is default filter view. This way you will get all the default functionality of list without doing anything.Â
Hope this will help you!
Dipak
There are two good options available in fact three:
1- Using SharePoint Designer – We can create a page using SharePoint designer that having different places defined for containing different information from list columns. Because we are getting id from Query string, we can use XSLT to show the values in the formatted fields. – In my view, this is the best one because you don’t need to write a single line of code and SharePoint understand XSLT very efficiently and in optimized way. Â Â Â Â Â
2- Using SOM (Server Object Model)– Need to create a visual web (Or Custom/Generic Web part)Â that having different controls to handle the values. Now based on Query string we can filter out the list and fill the values in different controls. And then we can add the visual web part of page.
2- Using CSOM (Client Server Object Model)– Need to create a visual web (Or Custom/Generic Web part)Â that having different controls to handle the values. Now based on Query string we can filter out the list and fill the values in different controls.We can directly write the code on page.