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

If I specify multiple parameters for a DVWP, I seem to have to always provide a value in the query string or I get nothing. For example,

 [url]?filter=waldo&category=book

How would I specify "everything from waldo and not limited to books" presuming that I must provide the 'category' parameter in the URL (which seems to be true for this web part)? One would presume something like * should work but it doesn't.

There is a field for "default value" but the question still applies: how to specify any, or all, or don't care.

share|improve this question
add comment

2 Answers

You'll need a compound filter condition, something like this:

<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[@Category = $Category or $Category = '*']"/>

where

$Category is the parameter you've set up for the category Query String value

This way, if you pass an asterisk '*' for category, you'll get all categories.

share|improve this answer
add comment

Michael,

DefaultValue="*"

...should work.

But the question comes in with how that's passed to the query.

Can you post the SharePoint:SoapDataSource tag here for troubleshooting?

share|improve this answer
    
Will look for SoapDataSource, but for now with 'fair' and 'appt' specified within the DVWP, .../ReviewResume5.aspx?fair=something&appt=student returns a row .../ReviewResume5.aspx?fair=''&appt='' and .../ReviewResume5.aspx?fair=""&appt="" return nothing. –  Michael Broschat Jan 5 '11 at 12:55
    
The '*' will only work as a string value, not in any sort of wildcard way. –  Marc D Anderson Jan 5 '11 at 14:34
add comment

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.