0
How can I pass empty value in URL Parameter
New Here
,
/t5/dreamweaver-discussions/how-can-i-pass-empty-value-in-url-parameter/td-p/218224
Jul 06, 2006
Jul 06, 2006
Copy link to clipboard
Copied
Hi,
I am passing different URL parameters to one page, to filter the recordset on that page. How can I pass an empty value in the URL parameter so that the recordset in unfiltered?
The URL parameter is based on one field of the database: ContentType. So, the link would be to
default.asp?ContentType=Event
and then all records that have the ContentType field in the DB as Event are displayed. Is it possible to use this system to pass an empty parameter so that all records are displayed?
Thanks
Ian
I am passing different URL parameters to one page, to filter the recordset on that page. How can I pass an empty value in the URL parameter so that the recordset in unfiltered?
The URL parameter is based on one field of the database: ContentType. So, the link would be to
default.asp?ContentType=Event
and then all records that have the ContentType field in the DB as Event are displayed. Is it possible to use this system to pass an empty parameter so that all records are displayed?
Thanks
Ian
TOPICS
Server side applications
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/dreamweaver-discussions/how-can-i-pass-empty-value-in-url-parameter/m-p/218225#M188212
Jul 06, 2006
Jul 06, 2006
Copy link to clipboard
Copied
?ContentType=All
<% if (ContentType == "All")
Build recordset w/o filtering
ASP is rusty, but those are the basics.
"iandobie" <webforumsuser@macromedia.com> wrote in message
news:e8im80$q7m$1@forums.macromedia.com...
> Hi,
> I am passing different URL parameters to one page, to filter the recordset
> on
> that page. How can I pass an empty value in the URL parameter so that the
> recordset in unfiltered?
> The URL parameter is based on one field of the database: ContentType. So,
> the
> link would be to
> default.asp?ContentType=Event
> and then all records that have the ContentType field in the DB as Event
> are
> displayed. Is it possible to use this system to pass an empty parameter so
> that
> all records are displayed?
> Thanks
> Ian
>
<% if (ContentType == "All")
Build recordset w/o filtering
ASP is rusty, but those are the basics.
"iandobie" <webforumsuser@macromedia.com> wrote in message
news:e8im80$q7m$1@forums.macromedia.com...
> Hi,
> I am passing different URL parameters to one page, to filter the recordset
> on
> that page. How can I pass an empty value in the URL parameter so that the
> recordset in unfiltered?
> The URL parameter is based on one field of the database: ContentType. So,
> the
> link would be to
> default.asp?ContentType=Event
> and then all records that have the ContentType field in the DB as Event
> are
> displayed. Is it possible to use this system to pass an empty parameter so
> that
> all records are displayed?
> Thanks
> Ian
>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
iandobie
AUTHOR
New Here
,
/t5/dreamweaver-discussions/how-can-i-pass-empty-value-in-url-parameter/m-p/218226#M188213
Jul 06, 2006
Jul 06, 2006
Copy link to clipboard
Copied
Hi Crash,
thanks for that - but how/where would I specify the 'if URL Parameter 'ContentType' is passed as 'All' then build unfiltered recordset' statement? Is this something i can do through the dreaweaver interface, or would I put the code in by hand at some specific point?
The code is HERE
Thanks
Ian
thanks for that - but how/where would I specify the 'if URL Parameter 'ContentType' is passed as 'All' then build unfiltered recordset' statement? Is this something i can do through the dreaweaver interface, or would I put the code in by hand at some specific point?
The code is HERE
Thanks
Ian
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/dreamweaver-discussions/how-can-i-pass-empty-value-in-url-parameter/m-p/218227#M188214
Jul 06, 2006
Jul 06, 2006
Copy link to clipboard
Copied
Which recordset are you sorting?
If it's this one:
Dim
Recordset1__MMColParam
Recordset1__MMColParam = "%"
If
(Request.QueryString("ContentType") <> "") Then
Recordset1__MMColParam =
Request.QueryString("ContentType")
End If
It actually looks like it's keeping the value at %, which I *thought* was a
wildcard in SQL, so should be bringing *anything* in....
I"m runnign to lunch, when I get back I'll check on that unless another
poster can confirm that % is wildcard (thus saying all categories should be
returned). Have you done the recordset w/o any other parameters to ensure
this wildcard will work on your content type?
If it's this one:
Dim
Recordset1__MMColParam
Recordset1__MMColParam = "%"
If
(Request.QueryString("ContentType") <> "") Then
Recordset1__MMColParam =
Request.QueryString("ContentType")
End If
It actually looks like it's keeping the value at %, which I *thought* was a
wildcard in SQL, so should be bringing *anything* in....
I"m runnign to lunch, when I get back I'll check on that unless another
poster can confirm that % is wildcard (thus saying all categories should be
returned). Have you done the recordset w/o any other parameters to ensure
this wildcard will work on your content type?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
iandobie
AUTHOR
New Here
,
/t5/dreamweaver-discussions/how-can-i-pass-empty-value-in-url-parameter/m-p/218228#M188215
Jul 06, 2006
Jul 06, 2006
Copy link to clipboard
Copied
When I made the recordset in the advanced recordset dialogue,
I set the default value of the URL parameter to '%' in the hope
that if no value was passed then all records would be returned.
However, it doesn't do it.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/dreamweaver-discussions/how-can-i-pass-empty-value-in-url-parameter/m-p/218229#M188216
Jul 06, 2006
Jul 06, 2006
Copy link to clipboard
Copied
Only if you're comparing against text, not numbers, and only
if you use LIKE
as your comparison, not = or any other test.
"iandobie" <webforumsuser@macromedia.com> wrote in message
news:e8jms6$84q$1@forums.macromedia.com...
> When I made the recordset in the advanced recordset dialogue, I set the
> default
> value of the URL parameter to '%' in the hope that if no value was passed
> then
> all records would be returned. However, it doesn't do it.
>
as your comparison, not = or any other test.
"iandobie" <webforumsuser@macromedia.com> wrote in message
news:e8jms6$84q$1@forums.macromedia.com...
> When I made the recordset in the advanced recordset dialogue, I set the
> default
> value of the URL parameter to '%' in the hope that if no value was passed
> then
> all records would be returned. However, it doesn't do it.
>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/dreamweaver-discussions/how-can-i-pass-empty-value-in-url-parameter/m-p/218230#M188217
Jul 06, 2006
Jul 06, 2006
Copy link to clipboard
Copied
So...do you have numbers or text listed? What's contained
within ContType?
"Lionstone" <HIDElionstone@HIDEhushmail.com> wrote in message
news:e8jpe0$baf$1@forums.macromedia.com...
> Only if you're comparing against text, not numbers, and only if you use
> LIKE as your comparison, not = or any other test.
>
> "iandobie" <webforumsuser@macromedia.com> wrote in message
> news:e8jms6$84q$1@forums.macromedia.com...
>> When I made the recordset in the advanced recordset dialogue, I set the
>> default
>> value of the URL parameter to '%' in the hope that if no value was passed
>> then
>> all records would be returned. However, it doesn't do it.
>>
>
>
"Lionstone" <HIDElionstone@HIDEhushmail.com> wrote in message
news:e8jpe0$baf$1@forums.macromedia.com...
> Only if you're comparing against text, not numbers, and only if you use
> LIKE as your comparison, not = or any other test.
>
> "iandobie" <webforumsuser@macromedia.com> wrote in message
> news:e8jms6$84q$1@forums.macromedia.com...
>> When I made the recordset in the advanced recordset dialogue, I set the
>> default
>> value of the URL parameter to '%' in the hope that if no value was passed
>> then
>> all records would be returned. However, it doesn't do it.
>>
>
>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
iandobie
AUTHOR
New Here
,
/t5/dreamweaver-discussions/how-can-i-pass-empty-value-in-url-parameter/m-p/218231#M188218
Jul 06, 2006
Jul 06, 2006
Copy link to clipboard
Copied
The values that are contained within 'ContentType' are text:
Event, News, Feature or Portfolio. I can filter a recordset by any
one of these using a URL parameter, but can't display all
records.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
iandobie
AUTHOR
New Here
,
/t5/dreamweaver-discussions/how-can-i-pass-empty-value-in-url-parameter/m-p/218232#M188219
Jul 07, 2006
Jul 07, 2006
Copy link to clipboard
Copied
Does that mean i can define it in the SQL statement by adding
another parameter, something like
WHERE MBD_ContentType = MMColParam OR MBD_ContentType LIKE '%'
(or something like that - I'm only just getting to grips with SQL)
WHERE MBD_ContentType = MMColParam OR MBD_ContentType LIKE '%'
(or something like that - I'm only just getting to grips with SQL)
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
LATEST
/t5/dreamweaver-discussions/how-can-i-pass-empty-value-in-url-parameter/m-p/218233#M188220
Jul 10, 2006
Jul 10, 2006
Copy link to clipboard
Copied
I think so, have you tested this? I"m alone at the office and
it's been a
little hectic here.
little hectic here.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

