an ASP.NET Open Source CMS & eCommerce platform
Search:
Last Post 11/13/2008 9:47:52 AM By Spen. 10 replies.
11/12/2008 3:04:03 AM
Spen
Posts: 8
Joined: 10/23/2008
Validation issues
Hello there
 
We have added several categories to our dotshoppingcart  project. Everything is fine.
 
 
For example:
 
Our category is ‘notebook accessories’
 
Therefore our url is
 
http://localhost/store/category/store/notebook accessories.aspx
 
Is it possible to trim or remove the whitespace between ‘notebook and ‘accessories’ as this is causing validation errors?
 
We don’t want to change the category name though.
 
Thanks
11/12/2008 8:08:52 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Validation issues
What validation error did you get? A lot of our customer sites are using category name with whitespace inside just fine.
DotShoppingCart Staff
11/12/2008 8:17:27 AM
Spen
Posts: 8
Joined: 10/23/2008
Re: Validation issues
Thanks for getting back to me.
 
The error message is:
 
"A URI contains impermissible characters or quotes around the URI are not closed."
 
The validator will not accept the spaces, such as in the URI 'notebook accessories.aspx'
 
Thanks
 
Spen
11/12/2008 8:42:04 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Validation issues
Where did you get the validation from? Is it from your browser? Can you post back the screenshot?
DotShoppingCart Staff
11/13/2008 3:48:21 AM
Spen
Posts: 8
Joined: 10/23/2008
Re: Validation issues
Hey Lukezy
 
Thanks for getting back to me.
 
I got the validation information from Firefox. Here is the screenshot: http://development-ie.access.secure-ssl-servers.biz/images/screengrabs/bt2-validator-grab.jpg
 
Lines 236 - 347 are the bits I am interested in. It would be ideal if we could replace the whitespace with hyhens.
 
Cheers
 
Spen
11/13/2008 7:44:17 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Validation issues
The partial URL comes from product SKU. You could just replace whitespace with hyhens for your product SKU either manaully, or in code behind or SQL script. 
DotShoppingCart Staff
11/13/2008 8:21:41 AM
Spen
Posts: 8
Joined: 10/23/2008
Re: Validation issues
Hey Lukezy
 
Our problem occurs with the categories, which will be displayed on all pages. For example:
 
http://localhost/store/category/Store/Category/For%20Her/Accessories.aspx
 
The %20 is the validation trigger.
 
Cheers
 
Spen
 
 
11/13/2008 8:26:44 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Validation issues
%20 is the valid URL encoding for empty space. Why is %20 the problem?
DotShoppingCart Staff
11/13/2008 8:59:27 AM
Spen
Posts: 8
Joined: 10/23/2008
Re: Validation issues
This percentage is rendered by the browser to compensate whitespace, but it is not accepted by the validator.
 
Here is a link to the screen grab: http://development-ie.access.secure-ssl-servers.biz/images/screengrabs/category-validator-grab.jpg
 
The validator is generating warnings around the For Her category.
 
In the CategoryRow block you have a value Category.AbsoluteUrl.
 
Is it possible to amend this function to strip out the whitespace? Would the category page load if the whitespace was removed?
 
Thanks a million for your help.
 
Spen
11/13/2008 9:41:28 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Validation issues
Ok, it makes sense now. I think the right fix is to add "HttpUtility.UrlEncode" to Category.AbsoluteUrl. Let me know if it fixes for you.
DotShoppingCart Staff
11/13/2008 9:47:52 AM
Spen
Posts: 8
Joined: 10/23/2008
Re: Validation issues
That's great, thanks. I will have a go with that and get back to you.
 
Cheers!
 
Spen