473,395 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Handle # sign in url/querystring

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)
Apr 7 '08 #1
2 4864
"#"'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)
"David C" wrote:
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)
Apr 7 '08 #2
You have to URL encode many special symbols. I see you are already decoding
the URL sent.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
"David C" <dl*****@lifetimeinc.comwrote in message
news:uw**************@TK2MSFTNGP03.phx.gbl...
>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)


Apr 7 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Greg Zwierzynski | last post by:
HI , I am passing few parameters from one page to another. One of the parameters is order number. In one particular case the order number includes "&" sign : FE:.AT&T001 Next page reads the...
5
by: msnews.microsoft.com | last post by:
Hi, I am having a problem that the gateway I am working with removes the "=" sign from values in the postfield that are empty. Example: page.asp?aa=&ff=&xx=12 become: page.asp?aa&ff&xx=12....
9
by: cooldv | last post by:
i know how to replace the sign " when SUBMITTING a form in asp by this code: message = Replace(usermessage, "'", "''"). My problem is DISPLAYING data in an asp FORM, from an an access database,...
0
by: Samuel Fung | last post by:
Hi all, Can ASP retrieve UTF-8 encoded data in query string properly, when used with IIS 5.0 on Windows 2000 Pro/Server? With some trial and error, it seems that adding the directive...
11
by: Joey Martin | last post by:
I am passing a sql string thru my querystring for the next page to capture. example: www.xxxxxxxx.com/index.asp?str=select * from table where name like '%doe%' Passing a basic string works...
3
by: Ing. Branislav Gerzo | last post by:
Hello all, user have in browser address bar this URL: http://localhost/store/CDfilter.asp?catid=3&lngid=3&osid=7&ordertype=desc&orderby=release_date&PerPage=50&PageNum=2 I have on page filter...
4
by: thomas | last post by:
Anyone know how can I get a £ sign in the cell of a table that has been output by an xsl page I've tried <td>&#x00A3;<xsl:apply-templates select="./price" /></td> <td>£<xsl:apply-templates...
1
by: iam247 | last post by:
Hi I am a relative beginner with SQL and ASP. With some help after previous posts I have a page which successfully requests querystrings from another page and deletes a record from an access...
3
by: Simon Gare | last post by:
Hi All, I have a querystring that contains the + sign as a separator, I need to read these values individually in a select statement, for example. &text=Single+205 where single is the type...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.