Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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>"+
                   "<Eq>"+
                       "<FieldRef Name='Name'/>"+
                       "<Value Type='Text'>{parameter}</Value>"+
                   "</Eq>"+
                "</Where>"

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

share|improve this question

1 Answer 1

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
1  
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

 
discard

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.