I'm building a database-driven web store using ASP.NET 2.0/VB.NET and SQL Server 2005, and I have a user control that displays a list of product categories. The control makes use of a DataList and a method that calls a stored procedure. Each category in the list is hyperlinked to another page that displays a list of products in the chosen category.
Here's the problem:
I have no trouble executing the stored procedure to display the categories. However, some category names contain more than one word, and this results in my URLs* having spaces between words:
mywebstore.com/category.aspx?id=5&name=india pale ale
What I want is for the links to look like this:
I've tried formatting the URLs on the ASP.NET side, but I haven't had any luck, so I thought that maybe the category names could be formatted in the stored procedure so that they're already in the correct format by the time they're rendered on the .aspx pages.
Any help would be greatly appreciated. Thanks in advance.
* I purposely left out the "http://www.
" so that these fictitious links would not be converted to live URLs.