2

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?

5

Erm - you can just concatenate it into the string?

pdquery.Query = "<Where><Eq><FieldRef Name='Name'/><Value Type='Text'>"
                  + yourParameter + "</Value></Eq></Where>"
2
  • 2
    where yourParameter = Page.Request.QueryString["yourParameter"] 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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