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.
Query String
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Manesh GolekarRank #5,709 · 289 reputationPosted Jul 28, 2014, 11:46 PM EDT
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