Hi,
I want to use query string in sharepoint: i have my url and after url if i type empid=1 in url i have to get empid details in webpart.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Manesh GolekarPosted Jul 29, 2014, 3:46 AM
If 1 - empid is SharePoint List item ID
ready your query string id value and call getItemById method
SPListItem item = listObject.getItemById(empid);
item object will have all details
If 2 - empid is column in your list
build SPQuery basically CAML query to get resuls where empid value is query string value
SPListItemCollection itemColl = listobject.GetItems(query);
I hope this will help , let me know if any doubts. Thanks
M