G
Guest
Hi I have a list which pulls out items from a stored procedure. Unfortunately
some of the items it pulls out have apostrophes. This info need to be placed
in a URL but it keeps truncating at the apostrophe. When there is no
apostrophe all is well.
Example
With no apostrophe String = accessories No problem
subcategory.aspx?strSubCategory=Accessories&CategoryID=5
when string = Men's Slippers Truncated URL
http://localhost/dougboys-12-15/subcategory.aspx?strSubCategory=Men
I know the obvious would have been to use keys that were numbers but it was
not done this way for some reason. I realize that with apostrophes a double
quote would be needed but since they are being pulled from the database I can
not do that.
Suggestions?
Hear is the code
______________________________________________________
<ItemTemplate>
<a href='subcategory.aspx?strSubCategory=<%#
Server.UrlEncode(DataBinder.Eval(Container.DataItem,
"strSubCategory"))%>&CategoryID=<%#
request.querystring(Server.UrlEncode("categoryID")) %>' ><%#
DataBinder.Eval(Container.DataItem, "strSubCategory") %></a>
</ItemTemplate>
some of the items it pulls out have apostrophes. This info need to be placed
in a URL but it keeps truncating at the apostrophe. When there is no
apostrophe all is well.
Example
With no apostrophe String = accessories No problem
subcategory.aspx?strSubCategory=Accessories&CategoryID=5
when string = Men's Slippers Truncated URL
http://localhost/dougboys-12-15/subcategory.aspx?strSubCategory=Men
I know the obvious would have been to use keys that were numbers but it was
not done this way for some reason. I realize that with apostrophes a double
quote would be needed but since they are being pulled from the database I can
not do that.
Suggestions?
Hear is the code
______________________________________________________
<ItemTemplate>
<a href='subcategory.aspx?strSubCategory=<%#
Server.UrlEncode(DataBinder.Eval(Container.DataItem,
"strSubCategory"))%>&CategoryID=<%#
request.querystring(Server.UrlEncode("categoryID")) %>' ><%#
DataBinder.Eval(Container.DataItem, "strSubCategory") %></a>
</ItemTemplate>