Handle # sign in url/querystring

D

David C

I have an asp.net page that sends a file name to another page for display.
However, when a file name has a # sign in it the full url is cut off at the
# sign. Below is an example of the url and the applicable code at the
receiving page. Can anyone help me as to handling this condition? Thanks.

David

url = "http://server/showdocs.aspx?doc=Test with #.doc"

Dim currurl As String = HttpContext.Current.Request.RawUrl.ToString
Dim strFile As String = ""

'Grab the full decoded url
strFile = HttpUtility.UrlDecode(currurl)
 
B

bruce barker

"#"'s are not allowed in url parameters as they denote a bookmark. it should
have been encoded when the url was produced. you need to get this fixed
(should be translated to %23)

-- bruce (sqlwork.com)
 
C

Cowboy \(Gregory A. Beamer\)

You have to URL encode many special symbols. I see you are already decoding
the URL sent.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top