Hi there,
I built a simple URL provider to convert something like &CollectionName=Name to /Name. I use the following code:
foreach (var collection in collections)
{
list.Add(new Mapping("CollectionName", collection.CollectionName, collection.CollectionName));
}
This works fine. But as soon as I do this:
foreach (var collection in collections)
{
list.Add(new Mapping("CollectionName", collection.CollectionName.ToLower(), collection.CollectionName.ToLower()));
}
(e.g. convert both sides to lower case), the URL is no longer parsed and I end up with &CollectionName again. It also works when I just convert the UrlName:
foreach (var collection in collections)
{
list.Add(new Mapping("CollectionName", collection.CollectionName, collection.CollectionName.ToLower()));
}
Is this a bug, or is this by design? I can work around it by not converting the ParameterValue, but I was just wondering what's going on here.
Imar
Developer forum
E-mail notifications
Casing in URL Providers
Imar Spaanjaars
Posted on 13/05/2011 12:47:03
Replies
Vladimir
Posted on 16/05/2011 04:36:59
Hi Imar,
It's implemented according design.
I think it's done so, because parameterValue as rule is used to find values in DB.
For example, in the case of case-sensitive search in the database, our query would be
select * from myTable where keyID = parameterValue,
without any transformation of keyID to lowercase.
For search in array, hash and so on it also maybe useful
Vladimir
It's implemented according design.
I think it's done so, because parameterValue as rule is used to find values in DB.
For example, in the case of case-sensitive search in the database, our query would be
select * from myTable where keyID = parameterValue,
without any transformation of keyID to lowercase.
For search in array, hash and so on it also maybe useful
Vladimir
Imar Spaanjaars
Posted on 16/05/2011 19:01:33
Right, that makes sense. Thanks...
Imar
Nicolai Høeg Pedersen
Posted on 16/05/2011 21:37:03
And I believe that turning on case insensitive in the control panel will lower case it for you...
You must be logged in to post in the forum