That works well in a web page, but not in a library routine.
I made an assumption based on the group, which was probably not the
right thing to do.
If your libraries are not strongly coupled to the application, you can
pass in a context.
If you simply want to URL encode, however, you can use the HttpUtility
class. To do this:
1. Reference System.Web
2. Add a using/Imports statement (to be language agnostic)
Code (C#)
string encodedString = HttpUtility.UrlEncode(itemToEncode);
Code (VB)
Dim encodedString as String = _
HttpUtility.UrlEncode(itemToEncode)
Peace and Grace,
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Twitter: @gbworld
Blog:
http://gregorybeamer.spaces.live.com
*******************************************
| Think outside the box! |
*******************************************