1

is possibility send a variable from ParameterBinding to query in XsltListViewWebPart?

<Query>
  <Where>
     <Eq>
      <FieldRef Name="FileDirRef"/>
      <Value Type="Lookup">
        <xsl:value-of select ="$MyVariable"/>
      </Value>
    </Eq>
 </Where>
</Query>

1 Answer 1

0

If you're on SPD 2010, you can do this conveniently from the UI. Under List View Tools > Options > Parameters, create a new parameter, then add a filter which uses the newly created parameter. (In SPD 2013 it's similar, but getting the UI to show the List View Tools can be a bit trickier)

You can do this manually too: add a ParameterBinding (the example is for a querystring parameter; you didn't specify where your parameter will get its value from):

<ParameterBinding Name="someParam" Location="QueryString(paramName)" DefaultValue=""/>

Then edit your query to look like this:

<Query>
    <Where>
        <Eq>
            <FieldRef Name="SomeField"/>
            <Value Type="Text">{someParam}</Value>
        </Eq>
    </Where>
</Query>
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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