SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to pass a parameter between two separate web parts I am developing. In my 'Detail' webpart i need to build a CAML query to display the correct profile based on their name.

pdquery.Query = "<Where>"+
                       "<FieldRef Name='Name'/>"+
                       "<Value Type='Text'>{parameter}</Value>"+

not sure how i get the parameter into the this even possible?

share|improve this question
up vote 4 down vote accepted

Erm - you can just concatenate it into the string?

pdquery.Query = "<Where><Eq><FieldRef Name='Name'/><Value Type='Text'>"
                  + yourParameter + "</Value></Eq></Where>"
share|improve this answer
where yourParameter = Page.Request.QueryString["yourParameter"] – Vardhaman Deshpande Oct 11 '12 at 19:05
Yes ended up getting it about 5 minutes after I posted! Why it took me an hour to work that out I'll never know... – Stephen Oct 12 '12 at 9:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.